Opened 13 years ago
Last modified 4 years ago
#16893 closed Bug
negation of Q object returns the same thing — at Initial Version
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Not sure if this is a bug.
I was attempt to construct a Q object that wouldn't ever match anything (an API calls for a Q object to be returned, but certain situations call for nothing to be matched by it). I initially figured
~ Q()
Would do the trick, but that matches everything, just like a plain Q().
(I ended up using Q(pkisnull=True), which is a hack but seems to be OK.)
Note:
See TracTickets
for help on using tickets.