I have form defined like this
class DogForm(Form):
birthdate = DateField(u'Birthdate', validators=[DataRequired(message=u"User correct form D.M.Y")], format='%d.%m.%Y')
image = FileField(u'Image of a dog', validators=[Optional()])
submit = SubmitField(u'Save')
template like this
{{ wtf.form_field(dogForm.birthdate) }}
{{ wtf.form_field(dogForm.image) }}
{{ wtf.form_field(form.submit) }}
Upon subbmitting, if birthdate is given in wrong form,
form.validate_on_submit()
stops validating procces and gives back birthday error
view
form = dogForm()
if form.validate_on_submit():
add_dog(form)
return render_template("dog.html", form=form)
My problem is that file path from the FileField disappears in reloaded form and i can not event set it like other values
form.image.data = "somepath.."