okay, using ORM, the book_sub_book_link table is actually linked, it is also being used to force the ordering of the quert - although its probably not needed, as the datatables sort can do it by using sub_book_num and parent_id... Those values are still being put in by hand, so need to think about the parent_id bit... we need it to get the sorting to work. I think the sub_book_num would now be there in the normal book.dump() if I try to put it there -- would need to make sure the appropriate Schema is used of course
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
{% for book in books %}
|
||||
<tr>
|
||||
{% if book.sub_book_num is defined %}
|
||||
<td data-sort="{{book.id}}"><a href="/book/{{book.id}}"> {{book.title}}</a></td>
|
||||
<td data-sort="{{book.parent_id}}.{{book.sub_book_num}}"><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 %}
|
||||
@@ -83,6 +83,7 @@
|
||||
{% if books.sub_book is defined %}
|
||||
<p>sub_book is defined: {{books.sub_book}}</p>
|
||||
{% endif %}
|
||||
{{ books.subs }}
|
||||
{% endif %}
|
||||
|
||||
<!-- code to get bootstrap & bootstrap datatable to work -->
|
||||
|
||||
Reference in New Issue
Block a user