Ok, so let me explain the problem we're facing.  I'm using turbogears
with sqlalchemy.  I run a custom query by supplying the SELECT string
to the engine and then execute() that.  It returns back a list of
tuples.  I'd like it to return a bunch of instances of A but I can't
seem to find the api to do that.  Note that I'm not selecting
everything, just a few columns.  So, I wrote my own constructor which
basically runs through the tuple list and constructs instances of
class A and then returns that list back to my controller.

The problem is that when I'm exiting my controller, I find that I get
a duplicate key error because it seems like the controller in
turbogears tries to commit unsaved objects (the ones I manually
created for better access in my code).  Why is this?  How do I turn
this off?  I used session.clear() and it seemed to work but I'm not
comfortable using this.  Why can't I just create objects and not have
turbogears force commit them?

Any help would be appreciated here in understanding sessions and how
they work.  Is there an api that can be used to convert tuples into
instances?

Thanks.


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

Reply via email to