Flask_wtf FieldList根据BooleanField排序而不是出现的顺序

时间:2019-10-02 18:01:46

标签: flask flask-wtforms

class TakeQuizQuestionChoiceForm(FlaskForm):
    """
    Take Quiz Question Choice
    """

    selected = BooleanField(
        _('Selected'),
    )

class TakeQuizQuestionForm(FlaskForm):
    """
    Take Quiz Question
    """

    quiz_question_choices = FieldList(
        FormField(TakeQuizQuestionChoiceForm),
        min_entries=0,
    )

class TakeQuizForm(FlaskForm):
    """
    Take Quiz
    """

    quiz_questions = FieldList(
        FormField(TakeQuizQuestionForm),
        min_entries=0,
    )

我收到的是quiz_question_choices.data,它是由布尔值而不是其自然顺序排序的。可能是什么原因?

0 个答案:

没有答案