On Jan 28, 12:37 am, "avegas" <[EMAIL PROTECTED]> wrote:
> I'm playing around with using assign_mapper inside of a Turbogears
> projects, and I ran into a small problem. My assign_mappers work fine
> for taking things out of the database, but if I pull an object out,
> and add a pre-existing element(say a user to a session) to a relation
> and then attempt to put them back, I get errors about key conflicts
> because sqlalchemy attempts to insert the pre-existing elements,
> causing key conflicts.

im dont know TG much and didnt really understand your examples, but if 
youre getting key conflicts because you are re-saving 
instances....actually im not sure how youre pulling that off unless 
you are specifically blowing away the "_instance_key" element on the 
object...once an instance is INSERTed thats the only way it would 
conceivably INSERT it again.

other than that try to let SA handle creating your primary key values, 
in the case that you are setting the PK attributes on the instances 
yourself and saving over and over again.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to