On 10/10/07, James Brady <[EMAIL PROTECTED]> wrote: > > Hello all, > I'm a newcomer to SA, using it as the ORM for TurboGears at the > moment. > > Is there documentation/tutorials/recipes somewhere about how to > properly use SA from TurboGears? > > The problem I'm hitting at the moment is how to properly select simple > objects... There seems to be two main approaches, for example:
Read over these examples. Hopefully that answers your question. > session.query(Ownership).select() or http://lucasmanual.com/mywiki/TurboGears#head-6f83a62f8c04cde09ea95b375a4041ce0817c661 > ownership_table.select().execute() http://lucasmanual.com/mywiki/TurboGears#head-eb3ffb8d71d898537ec2538152d00dd243d5241e > > With the first approach, I get > InvalidRequestError: Parent instance <class 'tnf.model.Ownership'> is > not bound to a Session, and no contextual session is established; ... > which I'm not sure how tackle - there's no mention I can find of when > and where create_session should be called... > > The the second approach, the SELECTs work fine, but then I'm working > with RoxProxy objects, rather than my models, which don't have the > relations and back-references I've set up and that I obviously need. > > Can anyone answer these specific questions or point me in the > direction of some further documentation? > > Thanks, > James > > > > > -- -- TurboGears from start to finish: http://www.lucasmanual.com/mywiki/TurboGears --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---