Ticket #1393 (closed enhancement: wontfix)
Avoid module-globals in database.py
| Reported by: | alberto | Owned by: | anonymous |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1rc1 |
| Component: | TurboGears | Version: | trunk |
| Severity: | normal | Keywords: | database |
| Cc: |
Description (last modified by mramm) (diff)
database.py uses some module globals which assume there's only one TG app living in the process. TG 2.0 should allow mounting several apps, from different eggs, side by side in the same process so this pattern must be avoided.
A solution is to dump all these globals at the new turbogears.globals StackedObjectProxy? which is local to each app. Something like: turbogears.globals.hub, tg.globals.sa_engine, etc...
Alberto
Change History
comment:2 Changed 4 years ago by faide
- Type changed from defect to enhancement
- Milestone changed from 1.1 to 1.1.1
comment:4 Changed 3 years ago by mramm
- Keywords database added; database, sprint removed
- Version changed from 1.0.4b3 to trunk
- Description modified (diff)
- Milestone changed from 1.5 to 2.0
comment:7 Changed 3 years ago by mramm
Hmm, I agree this would be nice. But for normal TG applications it's extra complexity that people don't use. On the other hand for apps that people will want to mount inside other apps, but which have their own models, it would be very helpful.
So, I see a couple options thoughts:
1) a separate paster template for mountable apps 2) a recipie in the docs for how to do this 3) just do it and handle the extra complexity