Django Save Incomplete Progress on Form

后端 未结 3 1624
北海茫月
北海茫月 2021-01-11 20:38

I have a django webapp with multiple users logging in and fill in a form.

Some users may start filling in a form and lack some required data (e.g., a grant #) need

3条回答
  •  不知归路
    2021-01-11 21:07

    before Saving:

    for field in form.fields:
        form.fields[field].required = False
    

    then:

    form.save()
    

提交回复
热议问题