Edin, On Mon, Jul 16, 2007 at 11:20:57PM +0200, Edin Salkovic wrote: > On 7/16/07, Christoph Haas <[EMAIL PROTECTED]> wrote: > > > > I'm on SQLAlchemy 0.3.9 and SAContext 0.3.1 now with Pylons 0.9.6-rc1. A > > lot of knowledge is useless now that SQLAlchemy changed quite a few > > things regarding queries and Pylons doesn't have pylons.database any > > longer. > > > > Currently I'm trying to get myself acquainted with a lot of syntax and > > wanted to use the "paster shell" to play around. But when using > > SAContext the way it's described (pydoc sacontext) I just get this error > > when I try to query the database: > > > > ************************************************************************* > > > > In [4]: model.sac.query(model.Contact).get(1) > > --------------------------------------------------------------------------- > (...) > > ************************************************************************* > > > > Using pylons.database it was formerly necessary to bind the metadata to > > an engine somehow using: > > > > model.meta.connect(model.session_context.current.bind_to) > > > > What should I do now with SAContext? > > Briefly: > See the section "Pylons usage" from sacontext.py ( > http://sluggo.scrapping.cc/python/sacontext/sacontext.py ): > > The metadata you pass to your model's Tables etc. is sac.metadata, the > session_context is simply sac.session_context
Thank you so much. Actually I had trace amounts of DynamicMetaData flying around in my models and used that as meta data for the table in question. I have just used sac.metadata of course and the queries work. Yahoo! Thanks, Edin, you made my day. Christoph --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
