order pubisher list in book.html by name not id

This commit is contained in:
2020-12-05 20:28:11 +11:00
parent b34fc4edf9
commit e84e54bdab

View File

@@ -164,7 +164,7 @@ class BookForm(FlaskForm):
title = StringField('Title:', [validators.DataRequired()])
# author built by hand
# genre built by hand
publisher = SelectField( 'publisher', choices=[(c.id, c.name) for c in Publisher.query.order_by('id')] )
publisher = SelectField( 'publisher', choices=[(c.id, c.name) for c in Publisher.query.order_by('name')] )
owned = SelectField( 'owned', choices=[(c.id, c.name) for c in Owned.query.order_by('id')] )
covertype = SelectField( 'covertype', choices=[(c.id, c.name) for c in Covertype.query.order_by('id')] )
condition = SelectField( 'condition', choices=[(c.id, c.name) for c in Condition.query.order_by('id')] )