{% extends "base.html" %} {% block main_content %}

View/Edit Book

{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
{% for key in keys %}
{% if books[key] is iterable and books[key] is not string %} {% set cnt = namespace(idx=0, val=0) %} {% for objects in books[key] %} {% set cnt.val = 0 %} {% set str = namespace(val="") %} {% for attr in objects %} {% if attr != "id" %} {% if cnt.val > 0 %} {% set str.val=str.val+", "+objects[attr] %} {% else %} {% set str.val=str.val+objects[attr] %} {% endif %} {% set cnt.val = cnt.val + 1 %} {% endif %} {% endfor %} {% if key != "genre" %} {{str.val}} {% endif %} {% set cnt.idx = cnt.idx+1 %} {% endfor %} {% else %} {% if key == "notes" or key == "blurb" %} {% else %} {% endif %} {% endif %}
{% endfor %}
{% if books.sub_book|length %}

sub_book is defined: {{books.sub_book}}

{% endif %} {{ books.subs }} {% endblock main_content %}