Using Django 1.1 if I do:

1) sign into admin as user A in one browser and begin to edit a record
2) sign into admin as user B in another browser and begin to edit the
SAME record
3) make a change as user A and press Save
4) make a different change as user B and press Save

The result is that A's change is silently overwritten with user B's
change.

How do I make it so that user B gets an error telling them the record
has been changed by someone else since they started editing it? That's
what I would have expected to be the default behaviour.

I did some searching of the documentation but didn't find anything
obviously related. I also looked here at past posts and saw some
people asking similar questions but no obvious solutions. There was
some talk of adding SELECT FOR UPDATE functionality to Django 1.1, but
I don't know if that made it in, or how to use it if it did.

Can I perhaps add hooks to save a copy of the model object at the HTTP
GET time, and at HTTP POST pull another copy of the model back from
the db (distinct from the copy that is about to be saved) and compare
to the previous one from the HTTP GET then error if they're different?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to