55👍
✅
You should define a get_initial
method which returns a dictionary that contains the initial values:
class IncidentUpdateView(UpdateView):
def get_initial(self):
return { 'value1': 'foo', 'value2': 'bar' }
Alternatively, you can define an initial
value:
class IncidentUpdateView(UpdateView):
initial = { 'value1': 'foo', 'value2': 'bar' }
Source:stackexchange.com