#30053: Allow for conditional QuerySet.update_or_create()
-------------------------------------+-------------------------------------
     Reporter:  Joshua Cannon        |                    Owner:  Nasir
                                     |  Hussain
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  QuerySet             |             Triage Stage:
  update_or_create                   |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Joshua Cannon):

 True, and that's probably the closest we'll get to a client-side solution,
 but it does involve mechanics (atomic transactions) that a beginner (maybe
 even intermediate) Django programmer are likely to miss.
 It also relies on the user re-implementing the `setattr` logic in that
 nice little `# set obj attributes...` comment ;)

 I concede the unary callable condition is not something found elsewhere in
 Django, but I'd argue the benefit to client code (clean, readable, thread-
 safe code) is worth the new paradigm.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30053#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.29b56f43b1fac453a2bec05818ea7c1f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to