#1393: Avoid module-globals in database.py
-------------------------+--------------------------------------------------
Reporter: alberto | Owner: anonymous
Type: enhancement | Status: new
Priority: normal | Milestone: 2.0
Component: TurboGears | Version: trunk
Severity: normal | Resolution:
Keywords: database |
-------------------------+--------------------------------------------------
Changes (by mramm):
* keywords: database, sprint => database
* version: 1.0.4b3 => trunk
* milestone: 1.5 => 2.0
Old description:
> database.py uses some module globals which assume there's only one TG app
> living in the process. TG 1.1 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}}},
> {{{turbogears.globals.sa_engine}}}, etc...
>
> For backwards compatibility, a proxy to {{{turbogears.globals.foo}}} can
> be left at the old location. See {{{view.engines}}} at the trunk for an
> example.
>
> This is can also be a good time to add support for multiple engines per
> app as long as the API remains compatible.
>
> Alberto
New description:
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
--
Ticket URL: <http://trac.turbogears.org/ticket/1393#comment:4>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---