lektor.db.F

  • Template variable: F

When filtering a Query it's often necessary to refer to a field of an arbitrary record. This can be achieved with the F object. Any attribute of it refers to a field in the record. To make this clearer, have a look at the example below.

Accessing an attributes creates an Expression.

Example

<ul>
{% for item in this.children.filter(F.status == 'published') %}
  <li>{{ item.title }}</li>
{% endfor %}
</ul>

Comments