On Feb 6, 2008, at 8:26 AM, Werner F. Bruhin wrote:
> > In my wxPython GUI I get an error if I reselect the same object and > then > issue a commit. > > I get the exception: > InvalidRequestError: Object 'Tastingsys(tastingsysid=5, ..., > xmltype=u'GEN100')' is already attached to session '114990800' (this > is > '63582576') > > I would like to do something like: > ormobject._instance_key == ormobject._instance_key > > Above seems to work for me but I don't like using "_instance_key" as > it > is declared privat, what is a cleaner way of doing this check? > if you are working with the same session, two objects can be compared based on identity: ormobject1 == ormobject2 this is because the session keeps instances unique based on its own identity map. im not seeing how any of this leads to the error you're getting though, you'd have to show me more completely what you're doing. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---