Model Meta option default_related_name not setting related_query_name

52 views
Skip to first unread message

Alejandro Do Nascimiento

unread,
Nov 13, 2015, 1:40:27 PM11/13/15
to django...@googlegroups.com
django...@googlegroups.com

Hello,

I have a doubt, In a model I'm using the Meta option default_related_name, this sets the related manager but it doesn't set the related_query_name as using related_name in a field would do, is this a bug or the intended functionality?

Neither the new feature ticket nor the django docs say anything about it.

Thx


--
AD.N

Tim Graham

unread,
Nov 14, 2015, 10:03:57 AM11/14/15
to Django users
I guess it would be backwards incompatible if we changed the behavior now, wouldn't it?

Simon Charette

unread,
Nov 14, 2015, 11:05:36 AM11/14/15
to Django users
Hi Alejandro,

This looks like a bug and overlook to me but as Tim pointed out simply changing it would be backward incompatible at this point.

If we were to fix this issue we would need to deprecate the actual behavior first. The deprecation path would involve raising a warning when the actual related_query_name is referenced (e.g. through Queryset.filter(), annotate(), ...) if default_related_name was defined and then switch to the new behavior once the deprecation period end.

If you are really motivated into fixing this please file a new ticket to track your effort.

Simon
Reply all
Reply to author
Forward
0 new messages