Hello, I would like to implement typical Save / Cancel dialog operating on normal SQLA objects.
For that purpose, the most convenient way is to make a shallow copy of an object using copy.copy(obj), let the user edit this object, and on user pressing OK in dialog replace it in SQLA, e.g. expunge existing object and add the edited object as replacement (and obviously drop the edited copy of object if user pressed Cancel instead). The reason I'm trying to do this instead of just doing session.commit() or session.close() on the changed object is that editing in my app is pretty complicated and it is done across many http requests, so I obviously need to save the state of the object in between them. Are there any problems with such approach? Risks? Is this safe? There obviously have to be some issues, such as enforcing the same PK in a new obj as in the old object, which is the first issue that comes to my mind. Regards, mk --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
