Opened 11 years ago
Closed 11 years ago
#5409 closed (fixed)
Logic error in the db-api documentation
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | master |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
in http://www.djangoproject.com/documentation/db-api/#exclude-kwargs
This example excludes all entries whose pub_date is later than 2005-1-3 AND whose headline is NOT “Hello”
should read:
This example excludes all entries whose pub_date is later than 2005-1-3 OR whose headline is NOT “Hello”
That is because "select not x and not y" is equivalent to "select not (x or y)" and, therefore, "exclude x or y"
Attachments (2)
Change History (5)
Changed 11 years ago by
Attachment: | logic-error.diff added |
---|
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Thanks ramiro, you are absolutely right.
I have updated the patch.
comment:3 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
David is talking about the
example. But the sentence he suggests is also wrong, after applying the De Morgan's law as he rightly suggests it should read: