Files
books/README
2020-11-24 21:26:51 +11:00

37 lines
2.5 KiB
Plaintext

### TODO: get all this inside a docker container and use compose to do the whole set (pg, flask, ?)
# 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:
- 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????)
- 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
### 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