#29108: TypeError: can only concatenate tuple (not "list") to tuple raised by
compiler.py
-------------------------------------+-------------------------------------
               Reporter:  Stephen    |          Owner:  nobody
  Brooks                             |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:             |        Version:  2.0
  Uncategorized                      |       Keywords:  TypeError list
               Severity:  Normal     |  tuple
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Seen in django version 2.0.2
 A model query triggers line 1448 in the file
 django/db/models/sql/compiler.py to raise a TypeError:

 `params = params + self.query.sub_params`

 ''TypeError exception: can only concatenate tuple (not "list") to tuple''

 This line is in the `as_sql` method of the `SQLAggregateCompiler` class.

 How to reproduce:
 Issue a query on a model which is related to another model, and include
 distinct, order_by (on a string field in the related model), a slice and a
 call to count().

 e.g.
    `Post.objects.distinct().order_by('author__last_name')[:20].count()`

 The presence of `distinct()` above, you could argue, is not needed,
 however, the above represents a simplification of the more complex query
 with which I originally saw the problem, and there the `distinct()`
 followed a more complex cross-table filter.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29108>
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/050.2fed91199216377709b3557099865a29%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to