#28484: QuerySet.extra keyword
               Reporter:  Antonio Carrasco  |          Owner:  nobody
                   Type:  Uncategorized     |         Status:  new
              Component:  Uncategorized     |        Version:  1.11
               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                 |
 Related to the #extra deprecation
 Given this example:

 queryset = Model.objects.all()
 ordered_ids = "1,3,5,7"
 queryset.annotate(custom=RawSQL(f"SELECT FIELD(id, %s)",
 queryset.extra(select={"custom": f"FIELD(id, {ordered_ids})"},

 The result of both queries is different. But executing the
 .query.__str__() query in the Mysql native console, the result is the
 The result with #extra is ok (the same the native mysql console returns)
 but the result with annotate is wrong.

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

Reply via email to