On Sun, Dec 14, 2008 at 9:10 AM, Jorge Vargas <[email protected]> wrote:
>
> totally agreed, declarative is very nice, and we already have it as
> default in TG2 quickstart, but if you have an older project which uses
> classic SA and uses the contextual mapper, it will be a little tedious
> to have to rename all your query calls, therefore I think we should
> provide a hint on the upgrade notes as to how to turn this back on.
> Which now I can do thanks to your response.
>

You definitely don't have to do that.  You can use the following in
your model/__init__.py:

DeclarativeBase = declarative_base(mapper=DBSession.mapper)

This allows you to use the DeclarativeBase unchanged from the
quickstart models but it gives you the use of MyModel.query syntax.



-- 
Lee McFadden

blog: http://www.splee.co.uk
rejaw: http://rejaw.com/splee
twitter: http://twitter.com/splee

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to