Hola,
Yo haría algo así:
Código Python:
Ver originalfrom django.views.generic import FormView
from .models import MyModel
class CreateObject(FormView):
model = MyModel
template_name = "forms/form_create.html"
form_class = MyModelForm
form_valid(self, form):
response = super(CreateObject, self).form_valid(form)
title, body = form.cleaned_data['title'], form.cleaned_data['body']
self.model.objects.create(title=title, body=body)
form.save()
return response