[Django] #28177: Clarify documentation with regards to Q objects and OR

8 views
Skip to first unread message

Django

unread,
May 7, 2017, 1:37:10 AM5/7/17
to django-...@googlegroups.com
#28177: Clarify documentation with regards to Q objects and OR
------------------------------------------+------------------------
Reporter: Yoong Kang Lim | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------+------------------------
In the QuerySet documentation it is written:

In general, Q() objects make it possible to define and reuse conditions.
This permits the construction of complex database queries using |
(OR) and & (AND) operators; **in particular, it is not otherwise
possible to use OR in QuerySets**.

It's possible to use OR without Q objects by simply using the | operator
on two querysets, e.g:

{{{
queryset = Article.objects.filter(headline__startswith='Hello') |
Article.objects.filter(headline__startswith='Goodbye')
}}}

Examples of this still remain in in the or_lookups tests, although I must
confess I haven't used this style much.

Perhaps the wording should be changed, or simply removed.

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

Django

unread,
May 7, 2017, 1:38:37 AM5/7/17
to django-...@googlegroups.com
#28177: Clarify documentation with regards to Q objects and OR
--------------------------------+------------------------------------------
Reporter: Yoong Kang Lim | Owner: Yoong Kang Lim
Type: Uncategorized | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+------------------------------------------
Changes (by Yoong Kang Lim):

* owner: nobody => Yoong Kang Lim
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28177#comment:1>

Django

unread,
May 7, 2017, 6:08:10 AM5/7/17
to django-...@googlegroups.com
#28177: Clarify documentation with regards to Q objects and OR
-------------------------------------+-------------------------------------
Reporter: Yoong Kang Lim | Owner: Yoong
Type: | Kang Lim
Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: assigned => closed
* type: Uncategorized => Cleanup/optimization
* resolution: => duplicate


Comment:

Duplicate of #21333

--
Ticket URL: <https://code.djangoproject.com/ticket/28177#comment:2>

Reply all
Reply to author
Forward
0 new messages