#25828: Aggregation and annotation using a postgres JSONField
-------------------------------------+-------------------------------------
     Reporter:  malefice             |                    Owner:
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  contrib.postgres     |                  Version:  master
     Severity:  Normal               |               Resolution:
                                     |  worksforme
     Keywords:  JSONField            |             Triage Stage:
  aggregation annotation             |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by mjtamlyn):

 * status:  new => closed
 * type:  Uncategorized => Cleanup/optimization
 * resolution:   => worksforme


Comment:

 This would be about supporting generic `__` lookups in more places. It's
 not a bug, it's a known restriction of the API for `values()` and
 `annotate()`. Now that transforms are expressions, it's possible that
 something like this should work:

 `.annotate(Avg(KeyLookup('key_name', 'field_name')))`

 but I haven't tried it, so syntax might not be quite right there. I
 believe that `annotate` works and `values` does not, but I may be wrong.

 In any case, annotation first and then using that annotation later will
 generally allow more complex queries than you can use directly.

 I'm going to close this for now as the expansion of the ORM to cover
 things like this does not need another ticket. If you can't find a way to
 make the above work (or similar) let me know.

--
Ticket URL: <https://code.djangoproject.com/ticket/25828#comment:4>
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/066.098d6cf304e8733190fa57be1e7a3743%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to