I agree, adding more functionality to the ORM for this one limited use case
doesn't seem worth it, especially given GenericRelation's existence.

On 18 April 2018 at 17:10, Tim Graham <timogra...@gmail.com> wrote:

> 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?
>
> On Tuesday, April 10, 2018 at 3:38:53 AM UTC-4, Carlton Gibson wrote:
>>
>> Hi All.
>>
>> https://github.com/django/django/pull/9748 adds the ability to perform
>> simple queries on a generic foreign key:
>>
>>     TaggedItem.objects.filter(content_object=object_instance)
>>
>> You still can't do anything more complex, such as:
>>
>>     TaggedItem.objects.get(content_object__name='Diamond')
>>
>> This is a long standing Someday/Maybe: https://code.dj
>> angoproject.com/ticket/3006
>>
>>
>>
>> The patch seems more or less OK to me but I'm not sure if we shouldn't
>> *instead* guide users firmly towards defining a GenericRelation.
>>
>> GenericRelation provides for the more powerful querying, and, this way,
>> provides the one correct way™ to do things.
>>
>> I'm wondering what the correct view should be: whether we take this patch
>> or close the issue as wontfix and solely recommend GenericRelation.
>>
>>
>>
>> Thanks for your input.
>>
>> Kind Regards,
>>
>> Carlton
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/acf29f15-a3db-425f-b628-
> 71e87e5d3725%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/acf29f15-a3db-425f-b628-71e87e5d3725%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2J5zDz0Sr-TKp6uQpn7LkDYAAm28C83EK6kkW%3D0KZ0_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to