Ticket #11881: query.py.patch

File query.py.patch, 502 bytes (added by egenix_viktor, 6 years ago)

Patch against db/models/sql/query.py (Django 1.1, release version)

  • query.py

    old new  
    323323            query = AggregateQuery(self.model, self.connection)
    324324
    325325            obj = self.clone()
     326           
     327            # We don't need ORDER BY in the subquery, since it does not change the result
     328            obj.clear_ordering(True)
    326329
    327330            # Remove any aggregates marked for reduction from the subquery
    328331            # and move them to the outer AggregateQuery.
Back to Top