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.

Example

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>

Comments