household_composition_form.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:eq-survey-runner 作者: ONSdigital 项目源码 文件源码
def get_name_form(block_json, error_messages):
    class NameForm(Form):
        pass

    for question in SchemaHelper.get_questions_for_block(block_json):
        for answer in question['answers']:
            guidance = answer.get('guidance', '')
            label = answer.get('label') or question.get('title')

            field = get_string_field(answer, label, guidance, error_messages)

            setattr(NameForm, answer['id'], field)

    return NameForm
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号