def custom_create(request):
 class SlugChangingArticleForm(forms.ModelForm, ):
  'Custom form class to overwrite the slug.'
  class Meta:
   model = Article
  def save(self, *args, **kwargs):
   self.instance.slug = 'some-other-slug'
   return super(SlugChangingArticleForm, self).save(*args, **kwargs)
 from django.views.generic.create_update import create_object
 return create_object(request, post_save_redirect='/create_update/view/article/%(slug)s/', form_class=SlugChangingArticleForm)

def custom_create ( request ) : class SlugChangingArticleForm ( forms . ModelForm , ) : class Meta : model = Article def save ( self , * args , ** kwargs ) : self . instance . slug = 'some-other-slug' return super ( SlugChangingArticleForm , self ) . save ( * args , ** kwargs ) from django . views . generic . create_update import create_object return create_object ( request , post_save_redirect = '/create_update/view/article/%(slug)s/' , form_class = SlugChangingArticleForm )
calls create_object generic view with a custom form class .