Kirk Strauser schrieb:
> Nope, with "plain" SA you have to use the session, since the class 
> definitions 
> inherit from Python's "object" class and the table objects don't have any 
> concept of sessions or database connections.

But (in the default project template) the classes are mapped to the 
table with a session-aware mapper, so instead of

session.query(Types.Ship).filter_by(shipid=args['shipid'])

you can just write

Types.Ship.query.filter_by(...)

Also, you don't need a session.commit() since every request is 
automatically wrapped in a transaction. But may what you forget is to 
flush changes to the database (TG does not use autoflush).

I've written big projects with TG 1.0 using plain SQLAlchemy, and it 
really works very well, so you should really give it another try ;-)

-- Christoph


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to