Ticket #12258: d.diff

File d.diff, 458 bytes (added by jdunck, 6 years ago)
  • django/db/models/query.py

    diff --git a/django/db/models/query.py b/django/db/models/query.py
    index 6a16ce1..f4baa2b 100644
    a b class QuerySet(object): 
    320320        keyword arguments.
    321321        """
    322322        clone = self.filter(*args, **kwargs)
     323        if self.query.can_filter():
     324            clone = clone.order_by()
    323325        num = len(clone)
    324326        if num == 1:
    325327            return clone._result_cache[0]
Back to Top