lektor.db.
Query
The query class is used to filter queries to the database. It's available through either the Pad or through things like the children property of records.
Most operations on a query object return another one which will return a more filtered result.
Here a basic example of how to filter something in a template:
<ul>
{% for item in this.children.filter(F.status == 'published') %}
<li>{{ item.title }}</li>
{% endfor %}
</ul>
Returns all matching records as list.
Counts the total number of records a query matches.
Returns the set of unique values for a field.
Filters a query down by an expression.
Changes the query so that it includes or does not include hidden records.
Controls what happens to records that are not discoverable.
Changes the ordering of the query.
Requests a specific page from a pagination.
Returns the item at the query itself.
Comments