#17186: Inverted F expression (negation)
-------------------------------------+-------------------------------------
Reporter: niwi | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: SVN
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 1
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by lrekucki):
Replying to [comment:8 nate_b]:
> Regarding "Why ~F() instead of not F()": there are two reasons. One: To
match with [https://docs.djangoproject.com/en/dev/topics/db/queries
/#complex-lookups-with-q-objects Q objects]; Two, and more importantly:
python itself
[http://docs.python.org/library/operator.html#operator.__not__ does not
provide a __not__() method for object instances]. So yes, you are
absolutely right, but I don't think it can be done.
Ok, now I feel stupid ;)
>
> As to your other points, well taken. I hope my updated patch is an
improvement.
The patch looks good. Now we just need to work out the non-boolean cases
somehow.
--
Ticket URL: <https://code.djangoproject.com/ticket/17186#comment:9>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.