Malcolm Tredinnick wrote:
> If you only want a unique object, make sure that
> the arguments you provide as the defaults argument specify it must be
> unique at the database level.

BTW, may be get_or_create should be rewritten as:

     get()
     try:
         create()
     except BackendSpecificUniqueConstraitFailure:
         get()

?

> This is the case where we can lift "SELECT FOR UPDATE..." transaction
> control into the Python level. Again, it lets the database be the
> serialisation point. In agreement about the need for a solution here,
> not quite sure how to spell it at the Python API level yet.

Model.objects.get_for_update()
Model.objects.filter(...).for_update()

?

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

Reply via email to