Commit Graph

24 Commits

Author SHA1 Message Date
5f46636298 created generic id_name_form.html and made condition, covertype, genre, owned, publisher & rating use it for single edit page 2020-11-18 12:09:02 +11:00
8ebf9b73cb rewrite to be more generic 2020-11-18 12:03:02 +11:00
Damien De Paoli
9544790ffa removed all old *_lst tables, added corresponding new classes, etc. fro covertype, owned, rating, and dropped tables from DB, etc. Updated base.html to use new tables as drop-downs that are set correctly. So far slight hack on BookForm, will finish that after syncing this all back to mara. If I do the sync, and export/import this version of DB, then the fixes.sql and fix_db() code included in main.py can be removed. Finally, lamely added a favicon and a static/ to support it 2020-11-17 21:22:15 +11:00
757729f159 tweaked pagination size to 20 now that navbar takes up so much space, also made pagination choices match 2020-11-16 00:05:00 +11:00
797e043c20 sort table by name 2020-11-16 00:04:21 +11:00
58695629dc okay, condition* now works, menu to call them works, just testing it out though, so also a BookForm started but unused at present. Finally, tweaked pagination size to 20 now that navbar takes up so much space, also made pagination choices match 2020-11-16 00:03:28 +11:00
1de0ed27d9 fixed up genres.html, publisers.html to work, tweaked menu structure -- still more placeholders than working for now, but started on an Admin menu to allow dealing with genres, covertypes, conditions, etc. 2020-11-15 14:26:52 +11:00
e39a4da6a2 removed all refs to genre_lst, made genre table confirm to id, name, added classes/routes for genre*, tweaked book format to accommodate multiple authors, etc. still 1-line, but with 12 / num of <authors, etc.> col wide form-controls 2020-11-15 14:16:58 +11:00
7334e4b622 bit of pox code, to go through sub fields like author/publisher, and build readonly links to their edit pages, works. Need to add to books.html - which also only prints the first item - like author anyway 2020-11-15 13:29:49 +11:00
29f8189c97 fixed bug with route to / now needing to be to base.html, not main.html, then just added publisher (list all/edit 1/deleted button) 2020-11-14 15:33:43 +11:00
79a41b4f0e split out old books into book and books.html, all *.html now using extends and {% block %} in jinja2. So navbar is now present in all URLs 2020-11-14 12:09:35 +11:00
b885bf30e4 now using jinja2 block / template, rather than jscript to fill content 2020-11-14 11:20:52 +11:00
5fd4479555 first pass at a token navbar experience 2020-11-13 17:55:48 +11:00
77fd5619f6 now using wtforms for fields, formatting is still not right with bootstrap4, but it will have to do 2020-11-13 17:07:15 +11:00
db47770720 now using wtforms for fields, formatting is still not right with bootstrap4, but it will have to do 2020-11-13 17:07:02 +11:00
a4dca1dbf5 updated README to reflect next steps (will use flask-wtf and flask-boostrap), but proof-of-concept author/<id> works to save to database with a form / POST 2020-11-11 19:23:48 +11:00
14749de303 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 2020-11-08 19:53:05 +11:00
a57d68ecfa made genre use the schemas properly to return actual joined data, not just genre_id. Also made author/publisher/genre all use many=True, while that is nto true for publisher, it makes the jinja code consisten -- Might need to fix this one day if the writing to the database is somehow more automatic and needs it to be an actual one-to-many, not a many-to-many 2020-11-08 15:46:59 +11:00
c4fe3422a3 Keeping flask-marshmallow as its too hard to do my own objects, due to SqlAlchemy using its own list that is not iterable, etc. Added Genre, ALSO, beware table names with an underscore are messed with, and should be explictly defined - found out this the hard way with genre_lst 2020-11-08 15:07:36 +11:00
761d2af391 first pass at using jinja2 to make an edit form dynamically, its a bit hit and miss :( 2020-11-07 13:03:10 +11:00
1fcd0ed797 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 2020-11-06 17:26:50 +11:00
21c792203c added in publisher relationship (via book_publisher_link), removed debug, also removed ma.Nested, not needed? 2020-11-04 23:48:09 +11:00
2a7cbe5845 using font awesome, datatables, bootstrap and fixed so class attributes are serialized via marshmallow and it all works with jinja2 now 2020-11-04 19:26:36 +11:00
a51db7c9e4 initial commit of book library in python with sqlalchemy (as an ORM), flask (for the web server) and jinja2 (as the web template front-end bit) 2020-11-03 18:29:41 +11:00