Skip to main content

Try this way:

super(ViagemForm, self).__init__(*args, **kwargs) if field_value: #self.initial[field_name] = field_value self.fields[field_name].initial = field_value 

Try this way:

if field_value: #self.initial[field_name] = field_value self.fields[field_name].initial = field_value 

Try this way:

super(ViagemForm, self).__init__(*args, **kwargs) if field_value: #self.initial[field_name] = field_value self.fields[field_name].initial = field_value 
Source Link
ndpu
  • 22.6k
  • 6
  • 61
  • 72

Try this way:

if field_value: #self.initial[field_name] = field_value self.fields[field_name].initial = field_value