[sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Alvaro Reinoso
Ok, This is the code: @staticmethod def insert(string, mode): Insert a new item given a string screenGroup = ScreenGroup() session = rdb.Session() try: if mode == XML:

Re: [sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Michael Bayer
The most suspicious thing is self.__dict__['foo'] = list() as well as the direct access to self.__dict__['foo']. If self is a mapped object, then thats your issue. Also note this is still an out of context cut-and-paste, if you really want me to figure it out it has to be an isolated test

[sqlalchemy] Re: Weird error when adding a new object

2010-11-19 Thread Alvaro Reinoso
Got it. I just change session.add(screenGroup) to session.merge(screenGroup) and it works. Thank you for you help, it's always really useful. On Nov 19, 3:10 pm, Michael Bayer mike...@zzzcomputing.com wrote: The most suspicious thing is self.__dict__['foo'] = list() as well as the direct