'Rendered fields manually from modelform..How can i save it?
I am beginner in django. I Rendered fields manually from modelform by using {{form.field_name}}.There are 5 fields in my model . how can i save field data by using class based view.
When Rendered fields by using {% form %} then i can save my form by using CreateView.like this
class StudentCreate(CreateView):
model = StudentDetails
fields = '__all__'
success_url = reverse_lazy('list-student')
but when i Rendered fields manually from modelform by using {{form.field_name}}.. i can't save it by using Createview.. Any idea about it? Why is this not working ? How can i save it?
Forms.py
class Student(forms.ModelForm):
class Meta:
model = StudentDetails
fields = "__all__"
Template code
{{form.name.label_tag}} {{form.name}}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
