After being unable to get any advice or further information via
google, #django or the users' mailing list, I opened
http://code.djangoproject.com/ticket/11652 regarding the admin
interface not preventing simultaneous editing of the same record (or
at least not providing that as an option). I guess this is not a
typical usage scenario, but for my use case I would like to implement
it if at all possible.

My first thought was to try grab a JSON representation of the original
record in an override of ModelAdmin.change_view; I thought I might be
able to save this via extra_context and somehow get it back when
change_view is called the second time for the HTTP POST of the
modified record. I was hoping to then compare that saved JSON
representation of the original record with the JSON representation of
the record as it exists in the database on that POST call; if they
differed then someone must have changed the record in the meantime and
so I could generate an error message.

I realized if I added an AutoField data to the record and saved that
instead, then that would be a lot cheaper to save and compare, but I
still don't know how to save that information.

Is there a way to save information in the session and get it back on
subsequent calls?

Using an AutoField date it would probably be sufficient to just know
when the original GET of the record happened for the user to start
changing it. Is there a way to find that out?

If anyone has any pointers or advice I'd be most grateful.

Cheers,
Dave

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

Reply via email to