I am using QuerySelectField in my forms.py and when submitting it I get the following error:
InterfaceError: (InterfaceError) Error binding para
Finally the issue is solved after hours of googling. the issue was about QuerySelectField. The problems was that when retrieving form.parent_id.data it actually returned a query object, whie I need a string vaue. So I converted the value to string and added submitted it to database:
a = str(form.parent_id.data)
if form.validate_on_submit():
new_menu = Menu(
form.title.data,
form.title_eng.data,
form.alias.data,
form.menu_type.data,
form.ordering.data,
form.check_out_time.data,
form.access.data,
form.published.data,
a, #form.parent_id.data,
form.image.data,
form.content.data,
form.content_eng.data,
form.metades.data,
form.metakey.data)
form.populate_obj(new_menu)
db.session.add(new_menu)
db.session.commit()