Reduce to_learn, callable, review into one status field
This commit is contained in:
parent
507531fbff
commit
d1e99c51de
4 changed files with 84 additions and 29 deletions
|
|
@ -45,9 +45,7 @@ def create_tune_instrument(tune_id):
|
|||
learned_from_id=data.get("learned_from_id"),
|
||||
tuning_id=data.get("tuning_id"),
|
||||
date_learned=data.get("date_learned"),
|
||||
callable=data.get("callable"),
|
||||
review=data.get("review"),
|
||||
to_learn=data.get("to_learn", False),
|
||||
status=data.get("status"),
|
||||
difficulty=data.get("difficulty"),
|
||||
)
|
||||
db.session.add(entry)
|
||||
|
|
@ -64,7 +62,7 @@ def update_tune_instrument(tune_id, entry_id):
|
|||
entry = db.get_or_404(TuneByInstrument, entry_id)
|
||||
data = request.get_json(force=True)
|
||||
fields = ("instrument_id", "learned_from_id", "tuning_id", "date_learned",
|
||||
"callable", "review", "to_learn", "difficulty")
|
||||
"status", "difficulty")
|
||||
for field in fields:
|
||||
if field in data:
|
||||
setattr(entry, field, data[field])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue