In my form, I got a class named Cform which is subclassed to ConstanceForm Cform(ConstanceForm)
In my views.py
class ResetCView(FormView):
template_name = 'c.htm.jinja'
form_class = Cform
model = CModel
def form_valid(self.form):
form.cleaned['C_CODE'] = settings.C_CODE
form.save()
retu HttpResponseRedirect(reverse('cview))
In my template:
<form method="post" action="{{url('c-reset')}}" name="form">
<button>Reset</button>
</form>
<form method="post" action="{{url('c-view')}}" name="form">
{{ form.as_p}}
</form>
My problem is it is not updating. Form is always invalid. I just want to reset my form or its database value to a specific data.
