Comment (by coleifer):
I'd like to work up a patch to merge in some of the functionality i've
written for dealing with GFKs -- including filter, annotate and aggregate:
https://github.com/coleifer/django-generic-
aggregation/blob/master/generic_aggregation/utils.py
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:17>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by auvipy):
Replying to [comment:17 coleifer]:
> I'd like to work up a patch to merge in some of the functionality i've
written for dealing with GFKs -- including filter, annotate and aggregate:
>
> https://github.com/coleifer/django-generic-
aggregation/blob/master/generic_aggregation/utils.py
go for it if you are still interested!!!
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:18>
Comment (by Karolis Ryselis):
I have created a pull request for this at
https://github.com/django/django/pull/9748. This special-cases generic
relations when filters are added to query. It only works for simple
lookups as nested lookups make no sense, i.e.,
`TaggedItem.objects.filter(content_object=obj)`
works and
`TaggedItem.objects.filter(content_object__name="name")`
will be caught by the old checks
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:19>
* stage: Someday/Maybe => Accepted
Comment:
can we conditionally accept this to move forward?
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:20>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:21>
* stage: Accepted => Ready for checkin
Comment:
Patch looks good. Not 100% sure it's needed given `GenericRelation` is
already available.
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:22>
Comment (by Tim Graham):
I'd lean toward a wontfix. In particular, making changes in
`django/db/models/sql/query.py` for a contrib app doesn't look like a good
separation of concerns. Is there a downside to the alternative of adding
the `GenericRelation`?
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:23>
* status: new => closed
* resolution: => wontfix
Comment:
Feel free to continue the [https://groups.google.com/d/topic/django-
developers/bCUDl7MlkOA/discussion discussion on django-developers] if
there's some motivation for this.
--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:24>