[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-14 Thread Christoph Zwerschke
Jorge Vargas schrieb: I'm trying to figure out how things like SAclass.query().something are setup in TG1, in order to see if it's possible to provide this functionality for TG2. in which the default is DBSession.query(SAclass) As was already answered here, the answer is Session.mapper.

[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-14 Thread Jorge Vargas
On Sun, Dec 14, 2008 at 4:25 AM, Christoph Zwerschke c...@online.de wrote: Jorge Vargas schrieb: I'm trying to figure out how things like SAclass.query().something are setup in TG1, in order to see if it's possible to provide this functionality for TG2. in which the default is

[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-14 Thread Lee McFadden
On Sun, Dec 14, 2008 at 9:10 AM, Jorge Vargas jorge.var...@gmail.com 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

[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-13 Thread Mark Ramm
This is super easy to do if you make all of your model classes inherit from a single ModelObject base class, and that's what the declarative does. Perhaps we should encourage something like this for TG2, even when people use plain SA. --Mark On Sat, Dec 13, 2008 at 10:17 PM, Jorge Vargas

[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-13 Thread Jorge Vargas
On Sat, Dec 13, 2008 at 10:27 PM, Mark Ramm mark.mchristen...@gmail.com wrote: This is super easy to do if you make all of your model classes inherit from a single ModelObject base class, and that's what the declarative does. ok someone on IRC pointed me to this

[tg-trunk] Re: how to get SAclass.query behavior in TG2?

2008-12-13 Thread Michael Brickenstein
Hi! I think you are referring to contextual mappers, aren't you? mapper=DBSession.mapper http://www.sqlalchemy.org/docs/04/session.html#unitofwork_contextual_associating Michael On 14 Dez., 05:35, Jorge Vargas jorge.var...@gmail.com wrote: On Sat, Dec 13, 2008 at 10:27 PM, Mark Ramm