2020-12-31 11:31:15 +11:00
2020-12-30 23:37:11 +11:00
2020-12-30 23:12:36 +11:00
2020-12-31 11:51:06 +11:00
2020-12-30 16:48:15 +11:00
2020-12-30 23:12:36 +11:00
2020-12-31 11:25:18 +11:00
2020-12-31 11:51:59 +11:00
2020-12-05 19:24:03 +11:00

### 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


### 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)

### TODO: 
	- need to trap failed sqls (e.g. delete a used foreign key - like a rating, should say gracefully alert you) - done for:
		- condition, covertype, genre, owned, rating, series: CRUD done
		- book update, delete
			-- I guess we could check for 'duplicate' book creation...
		ALSO series delete has different order of button and form.validate(), needed to work... 
		MUST use this when we have a validator that is fancier than not empty (year_published in book and num_books in series SO FAR)
	- consider created/modifed for all fields? but mostly are they set via ORM for new books?
		* No, not being set...
	- need to delete 1 sub_book from book
		* swap the 'add sub book' for 'remove from parent book' button and then act on it (separate route, simple sql exec and route back to (no-longer) child book) 
			(noting that deleting a child book already removes the book_sub_book_link)
	- when remove a Parent book from a series, what do we do?
		(remove all sub books from series too?)
	- need to delete all classes (and watch for referential integrity)
		* book (as long as no sub-books)... 
			-- dependency issue with series
		- can delete:
			author, publisher, series, condition, covertype, owned, rating, genre, loan,
	- should deleting really just ask if want to mark it as SOLD?
	- need to add books to loan (on loan page, and via a book search?)
	- need to delete book from loan
	- show books on shelf list
	- show books to buy view / printable
	- show unrated books  (with toggle to exclude those with missing in a series)
	- show books missing from a series (I own only some of them)
	- show books on wish list
	- show books that need replacing
	- show books I have sold
	- show books with poor rating
	- view list of possible duplicate books by title
	- consider which of the 'books maybe not valid' reports make sense still
	  (can you even have an N/A publisher now for example, but the genre one is interesting)
	- icons for on wish list, etc.?  (not sure I really want them, but if so)
		- wishlist: search-dollar OR https://www.flaticon.com/free-icon/wishlist_868517
		- save: https://www.flaticon.com/free-icon/sold_463255?term=sold&page=1&position=6&related_item_id=463255
	
	- with ORM: should I lazy load all books (ajax the 2nd->last pages in, or not use ORM, and do a quick db.execute()....)
Description
No description provided
Readme 602 KiB
Languages
Python 67.4%
HTML 31.7%
Dockerfile 0.6%
Shell 0.3%