I solved it using self.record.save_or_update()

j



Arun Kumar PG wrote:

> Looks like you are trying to use objects across different sessions.
>
> try to do an explicit session.expunge(obj) to the first object 
> returned before use the object in other session.
>
> On 4/19/07, *jose* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
>
>
>     hi group,
>
>     I have the following error that I don't know how to solve...
>     *
>     --------------------------------------------------
>
>     *self.record = Comune.get(pk)
>     *...
>
>     *self.record.get_from_dict (data=data,update=True)
>     if self.record._state['modified']:
>          self.record.save()
>
>     *sqlalchemy.exceptions.InvalidRequestError: ("Instance '<Comune 8150>'
>     is a detached instance or is already persistent in a different
>     Session",
>     <bound method Controller.save of <sicer.controllers.comune.Controller
>     instance at 0xb6b541ac>>)
>
>     *any ideas?
>
>     jo
>
>
>
>
>
>
> >


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