{% extends "base.html" %} {% block title %}{{ "Edit" if pk else "New" }} {{ res.label|lower }}{% endblock %} {% block body %}

{{ "Edit" if pk else "New" }} {{ res.label|lower }}

{% if errors %}

{{ errors }}

{% endif %} {% macro value_of(f) -%} {%- if row is none -%}{%- elif row is mapping -%}{{ row.get(f.name) if row.get(f.name) is not none else "" }} {%- else -%}{{ row|attr(f.name) if row|attr(f.name) is not none else "" }}{%- endif -%} {%- endmacro %}
{% for f in res.fields %} {% set editable = not (pk and f.name in res.pk) %} {% if not pk and auto_keys is defined and f.name in auto_keys %} {# Assigned by the database: show what it will be, but do not invite a value the Create model would discard. #} assigned automatically on save {% elif f.type in ("geopoint", "geojson") %} {# No input: geometry is derived, and round-tripping its binary representation through a text box would be meaningless. #}

Derived automatically; not editable here.

{% elif f.name in options %} {% elif f.type == "boolean" %} {% else %} {% endif %} {% if not editable %}primary key, not editable{% endif %} {% endfor %}
Cancel
{% endblock %}