tidy up doc string

This commit is contained in:
Damien Elmes 2021-02-19 10:04:57 +10:00
parent bdfd8add8a
commit b13d28cc5b

View file

@ -449,18 +449,21 @@ class Collection:
) -> Sequence[int]: ) -> Sequence[int]:
"""Return card ids matching the provided search. """Return card ids matching the provided search.
if order=True, use the sort order stored in the collection config To programmatically construct a search string, see .build_search_string().
if order=False, do no ordering
if order is a string, that text is added after 'order by' in the sql statement. If order=True, use the sort order stored in the collection config
you must add ' asc' or ' desc' to the order, as Anki will replace asc with If order=False, do no ordering
If order is a string, that text is added after 'order by' in the sql statement.
You must add ' asc' or ' desc' to the order, as Anki will replace asc with
desc and vice versa when reverse is set in the collection config, eg desc and vice versa when reverse is set in the collection config, eg
order="c.ivl asc, c.due desc" order="c.ivl asc, c.due desc".
if order is an int enum, sort using that builtin sort, eg If order is a BuiltinSort.Kind value, sort using that builtin sort, eg
col.find_cards("", order=BuiltinSortKind.CARD_DUE) col.find_cards("", order=BuiltinSort.Kind.CARD_DUE)
the reverse argument only applies when a BuiltinSortKind is provided;
otherwise the collection config defines whether reverse is set or not The reverse argument only applies when a BuiltinSort.Kind is provided;
otherwise the collection config defines whether reverse is set or not.
""" """
if isinstance(order, str): if isinstance(order, str):
mode = _pb.SortOrder(custom=order) mode = _pb.SortOrder(custom=order)