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:
@@ -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}}"> {{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 -->
|
||||
|
||||
Reference in New Issue
Block a user