#16211: using negated F()-expression in update query
-------------------------------------+-------------------------------------
     Reporter:  wdoekes              |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Ready for
     Keywords:                       |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by akaariai):

 I made some changes to the patch, mostly cosmetic changes to tests and
 docs.

 However, there was one real problem shown by Python 3 tests - now that F()
 objects override `__eq__` they are no longer hashable. This means they are
 not usable in sets or as keys in dicts. This can be a problem for users.
 If they are currently using F() expressions in sets, they can no longer do
 so. In addition this change required some refactoring in
 sql/expressions.py which used F() expressions in dicts.

 This patch is giving me an uneasy feeling because of the `__eq__` method.
 Otherwise I think this should be ready for checkin. We do not have the
 option to define other comparison methods except `__eq__`, users will try
 to use == anyways if other comparisons are implemented.

 Tracked in https://github.com/django/django/pull/405

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16211#comment:20>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to