Changes between Version 1 and Version 2 of Ticket #27849, comment 1


Ignore:
Timestamp:
Feb 16, 2017, 12:51:20 PM (8 years ago)
Author:
Tom Forbes

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27849, comment 1

    v1 v2  
    77There doesn't seem to be an easy way to subclass `ArrayAgg` and add elements to `data` or `params`, which is needed in this case. How could this be achieved without duplicating the entire `as_sql` code as it is currently? (it seems like the `as_sql` method should be broken up a bit, I think?)
    88
    9 It would be quite nice to be able to pass a whole, full-fat `QuerySet` into the aggregate, with the predicate that it is has been `values_list`'ed and is a relation of the model being queried (i.e `SomeModel.objects.annotate(foo=ArrayAgg('some_relation__id', where=SomeRelation.objects.filter(parent=F('id')).values_list('xyz'))` or somesuch. Is this even possible, or would it be chewing off too much?
     9It would be quite nice to be able to pass a whole, full-fat `QuerySet` into the aggregate, with the predicate that it is has been `values_list`'ed and is a relation of the model being queried (i.e `SomeModel.objects.annotate(foo=ArrayAgg(SomeRelation.objects.filter(parent=F('id')).filter(something=something_else).values_list('xyz'))` or somesuch. Is this even possible, or would it be chewing off too much?
    1010
    1111Oh, and is this a feature that Django even wants?
Back to Top