bleehu / CXDocs

Compound X rules displayed as web pages. Written in Python, served with Flask and bootstraped with bootswatch.
1 stars 1 forks source link

Create inventory entry Create Route #235

Open bleehu opened 5 years ago

bleehu commented 5 years ago

The database both in test and in prod for an inventory entry already exists. It expects the following schema:


-[ RECORD 1 ]------+-----------------------------
pk_id              | 2
created_at         | 2018-08-01 02:36:32.736263
name               | MarkAll(TM) Permanent Marker
quantity           | 1
private            | f
deleted_at         | 
fk_character_owner | 64
value              | 2```

The ask for this ticket is to create a route in `CXDocs/server/characters/character_routes.py` that when POSTed to, creates a new inventory entry with the appropriate data. 

See the Flask quickstart tutorial for how to make a new route.
http://flask.pocoo.org/docs/1.0/quickstart/

Recall that we should keep our functions small and readable. Thus, the logic for creating an inventory item should be a function, and the actual route in character_routes.py should call that function. The logic for all of the processing of creating a new inventory entry should not be in the function that declares the route.