On Aug 8, 6:30 pm, Steven Cummings <estebis...@gmail.com> wrote: > For backward compatibility, there may be a Model sub-class that would leave > Model alone altogether (this was suggested on the ticket). This seems fair > since many seem to be getting by without better optimistic concurrency > control from Django's ORM today.
Would the subclass-based method automatically append a field into the model, or would there be need to also create the field used for version control? How does the subclass know which field to use? Yet another option is models.OptimisticLockField(). If there is one present in the model, and a save will result in update, the save method will check for conflicts and set the version to version + 1 if there are no conflicts. There is some precedent for a somewhat similar field, the AutoField(). AutoField also changes how save behaves. I wonder what to do if the save does not result in an update and the version is set to something else than 1. This could happen if another user deleted the model and you are now saving it. This would result in a reinsert. This should also be an error? - Anssi -- 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.