3d12edab63cb591febca6cb680fa5020097d9514
### TODO: get all this inside a docker container and use compose to do the whole set (pg, flask, ?) see this for postgresal: https://hub.docker.com/_/postgres (has several env vars that should work out) and probably this: https://docs.docker.com/compose/gettingstarted/ (for flask and maybe redis) # flask -> python web server # sqlalchemy -> provides db-agnostic python objects of db content (and more) # flask-sqlachemy combines/wraps this to provide a db.* set of objects based on the 'app' that flask creates # marshmallow-sqlachemy provides a way to create a 'schema' of your class, then serialize an object to it # flask-wtf -> 'what the form' allows form consistency/validation based on defining attributes in a class for each form # flask-bootstrap -> allows me to format that wtf form with boostrap markup - yet to test if it also means I don't need to include it exlicitly in head, etc. # install needed binaries (maybe I could have done this instead of pip below too -- when I docker this shit, sort it out?) sudo apt install python3-pip python3-psycopg2 libpq-dev ### LEARN: supposedly could use virtualenv instead of pip3 install --user? OR even apt to install direct? # --user sticks python libs in ~/.local/[bin|lib|share] pip3 install --user flask sqlalchemy flask-sqlalchemy flask-marshmallow SQLAlchemy-serializer flask-wtf flask-bootstrap marshmallow-sqlalchemy # run the web server by: python3 main.py ### TODO: - need to save a book - still missing publisher, notes, blurb. - not sure about series/loan/subbook, etc. - need to create all classes (green + button) - need to delete all classes (and watch for referential integrity) - need to add 1 author to book, book to sub_book, series - need to delete 1 author from book - need to delete 1 book from sub_book, series, loan - need to create/add books to loan - add stats page - show books on shelf list - show books to buy view / printable - with ORM: do I to lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....) ### MAYBE: when moving a book in a series (which is part of 2 series), do we pop-up offer to move parent/child series orders as well to match (think Thomas Covenant) ### WARNING WARNING, edit book has broken publisher setting on GET of /book/<id>, DONT SAVE, until FIX as per below ### need to get publisher to be a single 1-to-many Foreign key, not linkage many-to-many table think I recall add new field to book (new_pub_id) as Foreign key use ORM to copy into new_pub_id, from publisher[0].id rename publisher to old_pub_field rename new_pub_id to publisher TEST delete book_publisher_link table delete column old_pub_field profit
Description
Languages
Python
67.4%
HTML
31.7%
Dockerfile
0.6%
Shell
0.3%