okay removed sub_book as a formal db.relationship, its too confusing, using raw sql for now. Still need to ensure ordering of sub_books based on book_id, sub_book_num AND need to pass enough sub_book fields that can vary so that jinja2 can show all subs of a book when editing any of them

This commit is contained in:
2020-11-06 17:26:50 +11:00
parent 1a2555739d
commit 1fcd0ed797
2 changed files with 26 additions and 28 deletions

View File

@@ -21,7 +21,11 @@
<tbody>
{% for book in books %}
<tr>
<td data-sort="{{book.id}}"><a href="/book/{{book.id}}">{{book.title}}</a></td>
{% if book.sub_book_num is defined %}
<td data-sort="{{book.id}}"><a href="/book/{{book.id}}">&nbsp;&nbsp;&nbsp;&nbsp;{{book.title}}</a></td>
{% else %}
<td data-sort="{{book.id}}"><a href="/book/{{book.id}}">{{book.title}}</a></td>
{% endif %}
<td>{{ book.author[0]['surname'] }}, {{book.author[0]['firstnames']}}</td>
<td>{{ book.publisher[0]['name']}}</td>
<td align="center">
@@ -42,6 +46,9 @@
{% else %}
<h3>Book</h1>
<p>{{books.title}}, {{ books.author[0]['surname'] }}, {{books.author[0]['firstnames']}} </p>
{% if books.sub_book is defined %}
<p>sub_book is defined: {{books.sub_book}}</p>
{% endif %}
{% endif %}
<!-- code to get bootstrap & bootstrap datatable to work -->