MCPcopy
hub / github.com/django/django / ordered

Method ordered

django/db/models/query.py:1988–2006  ·  view source on GitHub ↗

Return True if the QuerySet is ordered -- i.e. has an order_by() clause or a default ordering on the model (or is empty).

(self)

Source from the content-addressed store, hash-verified

1986
1987 @property
1988 def ordered(self):
1989 """
1990 Return True if the QuerySet is ordered -- i.e. has an order_by()
1991 clause or a default ordering on the model (or is empty).
1992 """
1993 if isinstance(self, EmptyQuerySet):
1994 return True
1995 if self.query.extra_order_by or self.query.order_by:
1996 return True
1997 elif (
1998 self.query.default_ordering
1999 and self.query.get_meta().ordering
2000 and
2001 # A default ordering doesn't affect GROUP BY queries.
2002 not self.query.group_by
2003 ):
2004 return True
2005 else:
2006 return False
2007
2008 @property
2009 def totally_ordered(self):

Callers

nothing calls this directly

Calls 1

get_metaMethod · 0.45

Tested by

no test coverage detected