I\'m using Class based generic views, can anybody suggest me how can i set the initial values to update form?
I tried using get_initial() method but didn\'t got any
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' }