Re: [Django] #3006: generic relations do not act as expected in a filter/get

11 views
Skip to first unread message

Django

unread,
Apr 30, 2012, 5:09:29 PM4/30/12
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: rmyers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: generic relations | Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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.

Django

unread,
Nov 25, 2015, 6:16:37 AM11/25/15
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: rmyers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage:

| Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Mar 3, 2018, 2:59:01 PM3/3/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers

Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage:
| Someday/Maybe
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Apr 5, 2018, 12:58:33 PM4/5/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Asif Saifuddin Auvi):

* stage: Someday/Maybe => Accepted


Comment:

can we conditionally accept this to move forward?

--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:20>

Django

unread,
Apr 10, 2018, 3:39:13 AM4/10/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/3006#comment:21>

Django

unread,
Apr 18, 2018, 10:03:01 AM4/18/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* 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>

Django

unread,
Apr 18, 2018, 12:18:01 PM4/18/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: generic relations | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Apr 18, 2018, 8:58:08 PM4/18/18
to django-...@googlegroups.com
#3006: generic relations do not act as expected in a filter/get
-------------------------------------+-------------------------------------
Reporter: jeroen_at_lbvd.nl | Owner: Robert
| Myers
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: wontfix

Keywords: generic relations | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* 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>

Reply all
Reply to author
Forward
0 new messages