Answer the question
In order to leave comments, you need to log in
How to make WTForms parse an AJAX list?
There is a form:
class AuthorForm(Form):
name = TextField('name', validators=[DataRequired()])
books = FieldList(TextField('book', validators=[DataRequired()]))
{
"books": ["Трудно быть Богом","Пикник на обочине","Парень из преисподней"],
"id":7,
"name":"Аркадий Стругацкий"
}
{'name': 'Аркадий Стругацкий', 'books': []}
print(request.data)
b'{"books":["\xd0\xa2\xd1\x80\xd1\x83\xd0\xb4\xd0\xbd\xd0\xbe \xd0\xb1\xd1\x8b\xd1\x82\xd1\x8c \xd0\x91\xd0\xbe\xd0\xb3\xd0\xbe\xd0\xbc","\xd0\x9f\xd0\xb8\xd0\xba\xd0\xbd\xd0\xb8\xd0\xba \xd0\xbd\xd0\xb0 \xd0\xbe\xd0\xb1\xd0\xbe\xd1\x87\xd0\xb8\xd0\xbd\xd0\xb5","\xd0\x9f\xd0\xb0\xd1\x80\xd0\xb5\xd0\xbd\xd1\x8c \xd0\xb8\xd0\xb7 \xd0\xbf\xd1\x80\xd0\xb5\xd0\xb8\xd1\x81\xd0\xbf\xd0\xbe\xd0\xb4\xd0\xbd\xd0\xb5\xd0\xb9"],"id":7,"name":"\xd0\x90\xd1\x80\xd0\xba\xd0\xb0\xd0\xb4\xd0\xb8\xd0\xb9 \xd0\xa1\xd1\x82\xd1\x80\xd1\x83\xd0\xb3\xd0\xb0\xd1\x86\xd0\xba\xd0\xb8\xd0\xb9"}'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question