James Bennett wrote:
> On Jan 30, 2008 9:18 AM, Michael Hipp <[EMAIL PROTECTED]> wrote:
>> Does Django have any built-in way to handle or prevent simultaneous,
>> incompatible edits to a database record?
> 
> No, that's what your database's concurrency handling is for.

Ok, I probably didn't explain well enough...

I'm using PostgreSQL so concurrency isn't a problem.

What is a problem is that user A loads a record and begins making changes. 
Then user B loads the same record and begins making different changes. One of 
them saves it first followed by the other and the only trace that's left is 
what was saved by the one that got there last.

No real issue at the database level. PG doesn't care. But possibly a very big 
issue at the application level (especially if each of the saves also modified 
related tables based on the different inputs of each user) and the application 
level of each could not know about the other so opportunities to prevent this 
disaster are few at the app level.

I've seen some table layouts that included a column like "last_edit_serial" so 
that a steadily incrementing serial could provide a hint to the app level that 
something had changed since the record was loaded.

But I don't see Django adding any such columns and was wondering if a 
different mechanism was in effect. Or if some other technique was widely used 
among Django users.

Any help or ideas appreciated.

Thanks,
Michael


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to