Ticket #32704: ticket-32704.diff

File ticket-32704.diff, 755 bytes (added by Mariusz Felisiak, 4 years ago)

Draft.

  • django/db/models/sql/query.py

    diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
    index 6629a1fd51..2563eebd76 100644
    a b class Query(BaseExpression):  
    20812081            self.deferred_loading = existing.union(field_names), True
    20822082        else:
    20832083            # Remove names from the set of any existing "immediate load" names.
    2084             self.deferred_loading = existing.difference(field_names), False
     2084            existing = existing.difference(field_names)
     2085            if not existing:
     2086                self.clear_deferred_loading()
     2087            else:
     2088                self.deferred_loading = existing, False
    20852089
    20862090    def add_immediate_loading(self, field_names):
    20872091        """
Back to Top