flask-mongoengine
flask-mongoengine copied to clipboard
allow_blank not working for StringField choices
For a model:
class Task(db.Document):
frequency = db.StringField(choices = (('daily', 'Daily'), ('monthly', 'Monthly'), ('yearly', 'Yearly')), verbose_name = 'Frequency')
And a form:
form = model_form(Task, FlaskForm, field_args = {
'frequency' : { 'allow_blank': True }
})
Results in:
TypeError: __init__() got an unexpected keyword argument 'allow_blank'
you may tell blank=true in
class Task(db.Document):
frequency = db.StringField(choices = (('daily', 'Daily'), ('monthly', 'Monthly'), ('yearly', 'Yearly')), verbose_name = 'Frequency', blank=True)