On 28 дек, 11:20, "Max Ischenko" <[EMAIL PROTECTED]> wrote:
>
> Another error I am now getting is:
> InvalidRequestError: Instance '[EMAIL PROTECTED]' is with key (<class '
> doupy.model.objects.Invoice'>, (73L,), None) already persisted with a
> different identity
>
> Any ideas how to fix this?
>
> Method impl. looks lke this (edited for brevity):
>     @transactional_method()
>     def create_invoice(self, wpuser, **kw):
>         invoice = Invoice(wpuser, public_id=str(next_id), **kw)
>         self.session.save(invoice)
>         return invoice

Randomly put db.session.clear() before create_invoice() call fixed it.
Black magic. ;-/

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