Hi,
example from Pylons application:
class DBAccountExtension(orm.interfaces.MapperExtension):
def after_insert(self, mapper, connection, instance):
response = hrd.user_create(instance.to_hrd())
if response['status'] == hrd.STATUS_OK:
instance.csa = response['resdata']['user']['id']
db.save_or_update(instance)
db.commit()
return orm.interfaces.EXT_CONTINUE
After saving model i'm making request to some API (to save data there
also). API return status information (response['resdata']['user']
['id']) which i want to update in database so i'm trying to do
db.save_or_update(instance) and then db.commit() but after this 2
lines application prints exception:
InvalidRequestError: Instance '<DBAccount at 0x134360d0>' is not
persisted
Any solutions?
(sorry for my english).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---