diff --git a/README b/README index dcd85f8..d691bb1 100644 --- a/README +++ b/README @@ -21,11 +21,16 @@ python3 main.py ### TODO: - ORM: - saving a book with the ORM is probably the last oddity... probably time to try it (in a sense, the book edit page is the only time we change things, maybe we mess with that book-query as its too slow, and for book edit, if we don't allow editing items like author/publisher, then may only need to set the objects we want to change... I'm sort of curious can you save a book table based on id, without saging its author table, seems that should be okay, but how do I save both, just create 2 objects and do it, but what if the ORM has auto-connected bunches of stuff, how do I update the connected stuff.... MAYBE, I need to get say loan or something first, then try all this? (make a pop-up for stuff like loans, but what about series or sub-book editing????) - - should see if I can make the publisher, rating, covertype, condition, genre tables have generic .html files - - complete BookSchema(FlaskForm) + - have no html for sub_book + - need to save a book + - need to allow create all classes + - need to delete all classes + - need to have up/down buttons for book in series (and sub book) + - need to delete 1 book from sub_book, series, loan + - add stats page + - show books on shelf list + - show books to buy view / printable -- consider getting rest of Book class connected, e.g. series, etc. - ### MAYBE, I should make this a self-contained docker instance, then its a copy of the DB and anything I break will be fixable ### next step is to rename genre_lst to genre, and maybe do similar to all _lst tables... then add genre.py in and get it to work diff --git a/templates/book.html b/templates/book.html index 2ba4327..2a184c7 100644 --- a/templates/book.html +++ b/templates/book.html @@ -4,8 +4,7 @@

View/Edit Book

{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %} - {{books.owned}} -
+
{% for key in keys %}
@@ -86,7 +85,19 @@ {% endif %}
{% endfor %} -
+ {% if books.series|length %} +
+ + + {% for s in books.series %} + + {% endfor %} +
+ Book {{ SeriesBookNum( s.id, books.id ) }} of {{s.num_books}} in {{s.title}} +
+
+ + {% endif %} {% if books.sub_book|length %}

sub_book is defined: {{books.sub_book}}

{% endif %} @@ -94,7 +105,20 @@

subs is defined {{ books.subs }}

{% endif %} {% if books.loan|length %} -

loan is defined: {{books.loan}}

+
+
+
Loaned to
+
+
{{books.loan[0].firstnames}} {{books.loan[0].surname}}
+

+ When: {{books.loan[0].date_lent}}
+ Contact: {{books.loan[0].contact_details}} +

+
+
+
{% endif %} +
+ {% endblock main_content %} diff --git a/templates/books_for_series.html b/templates/books_for_series.html index e5c0273..96839cc 100644 --- a/templates/books_for_series.html +++ b/templates/books_for_series.html @@ -3,6 +3,7 @@ TitleBook Number + {% set last = namespace(val=0) %} {% for book in books %} @@ -13,7 +14,13 @@ {{book.title}} - + {% set num = SeriesBookNum( series.id, book.id ) %} + {% if num == None %} + {# okay, if this is a parent book, the num == None, so make it use last real-book and add .01 to it to make sure it sorts just after the last one #} + + {% else %} + + {% endif %} {% for s in book.series %} {% if not book.child_ref|length %} {{ SeriesBookNum( s.id, book.id ) }} of {{s.title}}
@@ -36,6 +43,7 @@ {% endif %} {% endif %} + {% set last.val = num %} {% endfor %}