#28553: Querysets: annotate() columns are forced into a certain position which 
may
disrupt union()
-------------------------------------+-------------------------------------
               Reporter:  David      |          Owner:  nobody
  Sanders                            |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 (Reporting possible issue found by a user on #django)

 Using values() to force selection of certain columns in a certain order
 proved useful unioning querysets with union() for the aforementioned user.
 The positioning of columns added with annotate() is not controllable with
 values() and has the potential to disrupt union() unless this fact is
 known and the ordering done in a certain way to accommodate it.

 I'm reporting this mainly for posterity but also as a highlight that
 perhaps this should be mentioned in the documentation.  I'm sure there are
 reasons why the annotations are appended to the select but if someone
 feels that this is changeable then it would be a bonus outcome.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28553>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.08db9b3308ba8c299e359cd18f71654e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to