title: Django combine DetailView and FormView
body: <p>I have a view where I need to display information about a certain model instance hence I use a <code>DetailView</code>. I also need that same view to handle a regular form (not a model form), both displaying the form on <code>GET</code> and validating it on <code>POST</code>. To do that, I am trying to use a <code>FormView</code> however the combination of both view clases does not work:</p>
  
  <pre><code>class FooView(FormView, DetailView):
      # configs here
  </code></pre>
  
  <p>In <code>GET</code> (for simplicity of the question I will only show the issue with <code>GET</code> since <code>POST</code> has a different issue), it does not work because the form never gets added to the context. The reason has to do with method resolution order for that class:</p>
  
  <pre><code>&gt;&gt;&gt; inspect.getmro(FooView)
  (FooView,
   django.views.generic.edit.FormView,
   django.views.generic.detail.DetailView,
   django.views.generic.detail.SingleObjectTemplateResponseMixin,
   django.views.generic.base.TemplateResponseMixin,
   django.views.generic.edit.BaseFormView,
   django.views.generic.edit.FormMixin,
   django.views.generic.detail.BaseDetailView,
   django.views.generic.detail.SingleObjectMixin,
   django.views.generic.base.ContextMixin,
   django.views.generic.edit.ProcessFormView,
   django.views.generic.base.View,
   object)
  </code></pre>
  
  <p>Within the request, Django has to get the form and add it to the context. That happens in <code>ProcessFormView.get</code>:</p>
  
  <pre><code>def get(self, request, *args, **kwargs):
      """
      Handles GET requests and instantiates a blank version of the form.
      """
      form_class = self.get_form_class()
      form = self.get_form(form_class)
      return self.render_to_response(self.get_context_data(form=form))
  </code></pre>
  
  <p>However the first class with the MRO which has <code>get</code> defined is <code>BaseDetailView</code>:</p>
  
  <pre><code>def get(self, request, *args, **kwargs):
      self.object = self.get_object()
      context = self.get_context_data(object=self.object)
      return self.render_to_response(context)
  </code></pre>
  
  <p>As you can see the <code>BaseDetailView.get</code> never calls <code>super</code> hence the <code>ProcessFormView.get</code> will never be called hence the the form will not be added to the context. This can be fixed by creating a mixin view where all these nuances for <code>GET</code> and <code>POST</code> can be taken care of however I do not feel it is a clean solution.</p>
  
  <p>My question: is there any way of accomplishing what I want with Django's default CBV implementation without creating any mixins?</p>