disabled field is not passed through - workaround needed

后端 未结 7 524
夕颜
夕颜 2020-12-10 03:29

I have a form with which I want to update a MyModel object. On the model there is a unique_together constraint, fieldA together with fieldB. In the form in the clean method

7条回答
  •  一个人的身影
    2020-12-10 04:02

    In models.py add blank=True.

    Example:

    class myModel(models.Model):
          myField = models.CharField(max_length=30, blank=True)
    

提交回复
热议问题