#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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.b531c87f7a1a0dae24a6dc37239847d2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to