title: Django form inheritance for CreateView and UpdateView
body: <p>I have a CreateView and UpdateView for my model. They are really similar, only <code>dispatch</code> differs. I also have a long <code>form_valid</code> which should be applied with both, CreateView and UpdateView. How do I write this so there is no duplicity?</p>
  
  <p>I created a mixin like this:</p>
  
  <pre><code>class ModelMixin(object):
      def form_valid(self, form):
          ...
  </code></pre>
  
  <p>and then added it to views:</p>
  
  <pre><code>class ModelCreateView(ModelMixin, CreateView):
      pass
  
  class ModelUpdateView(ModelMixin, UpdateView):
  
      def dispatch(self, request, *args, **kwargs):
          #custom dispatch method for UpdateView
  </code></pre>
  
  <p>But I am not sure about this approach. I doubt I should inherit from <code>object</code> in ModelMixin. How to do this inheritance properly?</p>