On Sun, Dec 14, 2008 at 4:25 AM, Christoph Zwerschke <[email protected]> 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 >> DBSession.query(SAclass) > > As was already answered here, the answer is Session.mapper. > yes indeed thanks for that pointer Michael.
> However, I don't recommend porting the TG 1 SQLAlchemy setup to TG 2 > since it's actually a bit outdated. I am not recommending that, but now that I read on my post I didn't made it clear enough that this was in the context of TG1->TG2 migration. in which case I do think we should provide a hint as to how to enable this. > Instead, TG 2 should adopt the new > declarative usage with its simpler mapper, and maybe add some > functionality to our own classes. As Mark suggested, we should probably > invent a common base class for SQLAlchemy classes in TurboGears. We > could then also add some other gimmicks such as jsonification. > 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. > See also these comments over on the SQLAlchemy list: > http://groups.google.com/group/sqlalchemy/browse_thread/thread/bc7ecb50a4ef597c > > -- Christoph > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
