Skip to content

Commit a78178c

Browse files
committed
clarify filter text.
Ralf verified this rewording of his original text. Also added hyperlinks to some items.
1 parent 51501b3 commit a78178c

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

doc/reference.txt

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,25 +1515,31 @@ complex permission schemes. An `example in upgrading.html
15151515
shows the use of ``ctx``.
15161516

15171517
**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::
15231527

15241528
filter(db, userid, klass)
15251529

15261530
where ``db`` is the database handle, ``userid`` is the user attempting
15271531
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.
15371543

15381544
Note that the filter option is not supported for the Search
15391545
permission. Since the filter function is called *after* the search was

0 commit comments

Comments
 (0)