I am still new in django, i searched in FormView and CreateView source code and i found they both inheritate form same things
this is my simple view which has inherited from FormView
class MyFormView(FormView):
form_class = MyForm
template_name = 'form.html'
success_url = "/thanks/"
def form_valid(self, form):
form.save()
return super().form_valid(form)
i overwrote the form_valid method to try save my object
but in my CreateView
class PersonCreateView(CreateView):
model = Person
fields = '__all__'
template_name = 'form.html'
it saves my object automatically
New contributor
AArgh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.