MCPcopy Create free account
hub / github.com/O365/python-o365 / order_by

Method order_by

O365/utils/utils.py:1242–1256  ·  view source on GitHub ↗

Applies a order_by clause :param str attribute: attribute to apply on :param bool ascending: should it apply ascending order or descending :rtype: Query

(self, attribute=None, *, ascending=True)

Source from the content-addressed store, hash-verified

1240
1241 @fluent
1242 def order_by(self, attribute=None, *, ascending=True):
1243 """ Applies a order_by clause
1244
1245 :param str attribute: attribute to apply on
1246 :param bool ascending: should it apply ascending order or descending
1247 :rtype: Query
1248 """
1249 attribute = self._get_mapping(attribute) or self._attribute
1250 if attribute:
1251 self._order_by[attribute] = None if ascending else 'desc'
1252 else:
1253 raise ValueError(
1254 'Attribute property needed. call on_attribute(attribute) '
1255 'or new(attribute)')
1256 return self
1257
1258 def open_group(self):
1259 """ Applies a precedence grouping in the next filters """

Callers

nothing calls this directly

Calls 1

_get_mappingMethod · 0.95

Tested by

no test coverage detected