@@ -1515,25 +1515,31 @@ complex permission schemes. An `example in upgrading.html
1515
1515
shows the use of ``ctx``.
1516
1516
1517
1517
**filter**
1518
- A function to be executed on the results of a ``filter`` call of the
1519
- schema ``Class`` before displaying the results in an ``index``
1520
- template. Calling a ``filter`` method on all results is usually faster
1521
- than calling a ``check`` method (see previous paragraph) on *each
1522
- individual result*. The ``filter`` method has the signature::
1518
+ This optional function returns parameters for the ``filter`` method
1519
+ when getting ``Class`` items (users, issues etc.) from the
1520
+ database. It filters items at the database level (using SQL where
1521
+ possible). This pre-filters the number of items returned from the
1522
+ database when displaying results in an ``index`` template. This
1523
+ filtering is usually faster than calling a ``check`` method (see
1524
+ previous argument) on *each individual result*.
1525
+
1526
+ The ``filter`` method has the signature::
1523
1527
1524
1528
filter(db, userid, klass)
1525
1529
1526
1530
where ``db`` is the database handle, ``userid`` is the user attempting
1527
1531
access and ``klass`` is the ``Class`` in the schema.
1528
- The ``filter`` function must return a list of dictionaries of
1529
- parameters of the ``Class.filter`` call. Results found during a query
1530
- executed by an index template are passed through the filter calls
1531
- computed by the ``filter`` function. An empty list of filter
1532
- parameters indicates no access. Note that defining a ``filter``
1533
- function also needs the definition of a ``check`` function for
1534
- checking individual items for visibility. A ``check`` function is
1535
- manufactured automatically from a ``filter`` function if no ``check``
1536
- function is defined.
1532
+
1533
+ The ``filter`` function must return a *list* of dictionaries of
1534
+ parameters of the
1535
+ `Class.filter <design.html#:~:text=search_matches>`_ call. Results
1536
+ found during a query executed by an index template are passed
1537
+ through the filter calls computed by the ``filter`` function. An
1538
+ empty list of filter parameters (``[]``) indicates no access. When
1539
+ using a filter, a check function is still needed to test each
1540
+ individual item for visibility. When the filter function is defined
1541
+ but a check function is not defined, a check function is
1542
+ manufactured automatically from the ``filter`` function.
1537
1543
1538
1544
Note that the filter option is not supported for the Search
1539
1545
permission. Since the filter function is called *after* the search was
0 commit comments