diff doc/design.txt @ 5869:16e1255b16cf

Implement limit and offset for filter These map to the corresponding SQL parameters for the SQL backends.
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 26 Aug 2019 20:23:53 +0200
parents ee2e8f8d6648
children de9d602c8ce6
line wrap: on
line diff
--- a/doc/design.txt	Mon Aug 26 18:19:09 2019 +0200
+++ b/doc/design.txt	Mon Aug 26 20:23:53 2019 +0200
@@ -516,7 +516,7 @@
             """
 
         def filter(self, search_matches, filterspec, sort, group,
-                   retired, exact_match_spec):
+                   retired, exact_match_spec, limit, offset):
             """Return a list of the ids of the active nodes in this class that
             match the 'filter' spec, sorted by the group spec and then the
             sort spec. The arguments sort, group, retired, and
@@ -544,6 +544,14 @@
             items are returned. The default is False, i.e. only live
             items are returned by default.
 
+            The "limit" and "offset" parameters define a limit on the
+            number of results returned and an offset before returning
+            any results, respectively. These can be used when displaying
+            a number of items in a pagination application or similar. A
+            common use-case is returning the first item of a sorted
+            search by specifying limit=1 (i.e. the maximum or minimum
+            depending on sort order).
+
             The filter must match all properties specificed. If the property
             value to match is a list:
 

Roundup Issue Tracker: http://roundup-tracker.org/