1👍
✅
I’m thinking you are wanting a forms.ModelForm
instead of forms.Form
:
class ThisForm(forms.ModelForm):
class Meta:
model = TheModel
fields = ['text']
Then your view should be able to form.save()
. See here for the official documentation.
Source:stackexchange.com