Setting initial Django form field value in the __init__ method

前端 未结 6 648
余生分开走
余生分开走 2020-12-13 08:55

Django 1.6

I have a working block of code in a Django form class as shown below. The data set from which I\'m building the form field list can include an initial val

6条回答
  •  一个人的身影
    2020-12-13 09:35

    Make initial= "" in the field definition will solve your problem. Both proposed methods are correct you need just to define initial= "" in the field definitoion and the problem is solved

提交回复
热议问题