I posted this same issue to the issue tracker a couple months ago, here is the report:
http://code.djangoproject.com/ticket/11313 I do believe this is a shortcoming of the admin interface. I think that when fields became editable in 1.1, this was not handled and needs to be adressed in order for multiple people to modify at once. Currently the changelist is imlemented such that the ids of the forms in the changelist are just numerically ordered (first form is 1, second is 2, etc). Thus, if the database changes under you, when you then save your data, the forms that are generated (which are the result of a filter based on your current filter params) do not have the same numbering as the forms you just posted. This just doesn't work. I think that instead the implementation needs to be changed so that when an edited changelist is posted, each form carries with it the id of the object that it is for. Then, instead of filtering when the POST is received, the code needs to just extract the ids and use those as the queryest. This may be more detail than anyone wants - but I figured I'd post it just in case. In my own app, which has a lot of similarites to the admin app, I have done what I described above, and for me it has worked well. Margie On Aug 5, 12:06 pm, David <[email protected]> wrote: > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

