id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 22596 revert select_related qcxhome@… nobody "In some complicated situation, a QuerySet is passed through several methods to construct the final QuerySet. In this case, it's useful for developers to revert previous select_related due to that is not necessary for the final query. Fox example, a QuerySet like following is passed to another method, {{{ #!div style=""font-size: 80%"" {{{#!python # qs is constructed a little far from invocation to final_query qs = MyModel.objects.filter(...).select_related('author', 'priority') result = final_query(qs) }}} }}} only MyModel.summary field is required from the final query result. Definition of final_query would be {{{ #!div style=""font-size: 80%"" {{{#!python def final_query(qs): return qs.only('summary') }}} }}} but, the select_related is also applied to the final QuerySet. With the ability this ticket is requesting, developers are able to revert all unnecessary related fields. It's much convenient." New feature closed Database layer (models, ORM) 1.5 Normal duplicate Unreviewed 0 0 0 0 0 0