lektor.db.
Record
Records are Source Objects that come from the content/
folder and correspond to Data Models. They provide
a wider range of functionality compared to a standard source object but
they also provide all the functionality a regular source object does.
In addition to the functionality here, they also expose all the configured fields.
Most of the time things will just work as you expect. If you access these
objects from templates they give access to their built-in attributes as well
as custom fields through the attribute syntax. If however a built-in
attribute overlaps with your custom field, you need to access the fields
with the subscript syntax ([]
):
<p>Built-in Path: {{ obj.path }} <p>Path field: {{ obj['path'] }}
Looks up a field from the type.
Returns a query to the attachments of a page.
Returns a query to the children of a page.
Provides access to the raw contents of a record or attachment.
Provides access to the EXIF information of an image.
Returns the format of a supported attachment.
The previous and next children of this page's parent.
Whether the record has a next sibling.
Whether the record has a previous sibling.
Returns the height of an image in pixels.
Indicates if the record is a page or attachment.
Provides access to the pagination information.
Returns the configured label for this record.
Creates a thumbnail for an image.
Returns the width of an image in pixels.
Comments