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


Ignore:
Timestamp:
Oct 22, 2019, 2:27:04 AM (5 years ago)
Author:
Carlton Gibson

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30894, comment 2

    v1 v2  
    11OK, yes. Your models work the same. It's the presence of the `related_query_name` which causes the failure. Remove it and it works, because (as per the docs) `related_query_name` defaults to `related_name` if that's set.
    22
    3 At best this is a documentation cleanup/optimization **but** setting `related_query_name` explicitly is a much more specialised use case than setting `related_name`. I think the `related_query_name` docs are clear enough that setting it overrides the name of the reverse filter, and that a ''clarification'' in the `select_related()` docs would only muddy the water for the majority of users. (One should under the consequences before setting `related_query_name`.)
     3At best this is a documentation cleanup/optimization **but** setting `related_query_name` explicitly is a much more specialised use case than setting `related_name`. I think the `related_query_name` docs are clear enough that setting it overrides the name of the reverse filter, and that a ''clarification'' in the `select_related()` docs would only muddy the waters for the majority of users. (One should under the consequences before setting `related_query_name`.)
Back to Top