moved to using a Get*ById() in condition, covertype, owned files and exposing them in jinja and using them in books.html to fix-up the fact those columns were now raw forein keys (ids)

This commit is contained in:
2020-11-22 00:23:18 +11:00
parent 1edf5082c7
commit 9466e61db9
5 changed files with 31 additions and 10 deletions

View File

@@ -39,6 +39,11 @@ def covertypes():
covertypes = Covertype.query.order_by('id').all()
return render_template( "show_id_name.html", objects=covertypes, page_title='Show All Covertypes', url_base='covertype')
def GetCovertypes():
covertypes = Covertype.query.order_by('name').all()
cs = CovertypeSchema(many=True)
return cs.dump( covertypes )
################################################################################
# /covertype/<id> -> GET/POST(save or delete) -> shows/edits/delets a single
# covertype
@@ -65,3 +70,6 @@ def covertype(id):
covertype_form = CovertypeForm(request.values, obj=covertype)
message=""
return render_template("edit_id_name.html", covertype=covertype, alert=alert, message=message, form=covertype_form, page_title='Edit Covertype')
def GetCovertypeById(id):
return Covertype.query.get(id).name