If you initialized a form like this
form = CustomForm()
then the correct way from January 2019 is to use .initial to replace the data. This will replace the data in the intial text that accompanies the form. This also works if you initialized using some instance, such as form = CustomForm(instance=instance)
To replace the data in the form, you need
form.initial['Email'] = GetEmailString()
Summarizing this would be
form.initial['field_name'] = new_value
Vineeth Sai Jan 24 '19 at 10:57 2019-01-24 10:57
source share