[sqlalchemy] Re: FlushError: Can't change the identity of instance

2007-02-09 Thread Michael Bayer

svilen wrote:

 somehow u've managed to have 2 copies of same persistent-object -
 which should not happen; how did u get it?
 one has unicode-string '6', another one has int 6 instead - some
 conversion failing?

ughno!!  stop answering all these questions with the wrong
answersit  means the primary key attributes on a *single* instance
have been changed since it was last saved/loaded.  SA cant handle changes
to the primary key attributes on a single instance within the session -
see the FAQ page on the site for more information.



 Could please, someone tell me what the following error means?

 FlushError: Can't change the identity of instance
 [EMAIL PROTECTED] in session (existing identity: (class
 'sicer.model.fatturazione.Prestazione', (6,), None); new identity:
 (class 'sicer.model.fatturazione.Prestazione', (u'6',), None))

 



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



[sqlalchemy] Re: FlushError: Can't change the identity of instance

2007-02-08 Thread svilen

 somehow u've managed to have 2 copies of same persistent-object -
 which should not happen; how did u get it?

 I don't know.
can u prepare some short testcase ? and/or wait for those who know...

 one has unicode-string '6', another one has int 6 instead - some
 conversion failing?

 what is the best way to remove one of them?  session.clear(obj),
 session.expunge(obj) ?

 jo

 Could please, someone tell me what the following error means?
 
 FlushError: Can't change the identity of instance
 [EMAIL PROTECTED] in session (existing identity: (class
 'sicer.model.fatturazione.Prestazione', (6,), None); new
  identity: (class 'sicer.model.fatturazione.Prestazione',
  (u'6',), None))


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