title: In Django, how could one use Django's update_object generic view to edit forms of inherited models?
body: <p>In Django, given excerpts from an application <em>animals</em> likeso:</p>
  
  <p>A <em>animals/models.py</em> with: </p>
  
  <pre><code>from django.db import models
  from django.contrib.contenttypes.models import ContentType
  
  class Animal(models.Model):
    content_type = models.ForeignKey(ContentType,editable=False,null=True)
    name = models.CharField()
  
  class Dog(Animal):
    is_lucky = models.BooleanField()
  
  class Cat(Animal):
    lives_left = models.IntegerField()
  </code></pre>
  
  <p>And an <em>animals/urls.py</em>:</p>
  
  <pre><code>from django.conf.urls.default import *
  
  from animals.models import Animal, Dog, Cat
  
  dict = { 'model' : Animal }
  
  urlpatterns = (
    url(r'^edit/(?P&lt;object_id&gt;\d+)$', 'create_update.update_object', dict),
  )
  </code></pre>
  
  <p>How can one use generic views to edit Dog and/or Cat using the same form?</p>
  
  <p>I.e. The <em>form</em> object that is passed to <em>animals/animal_form.html</em> will be Animal, and thus won't contain any of the specifics for the derived classes Dog and Cat. How could I have Django automatically pass a form for the child class to <em>animal/animals_form.html</em>?</p>
  
  <p>Incidentally, I'm using <a href="http://www.djangosnippets.org/snippets/1031/" rel="nofollow noreferrer">Djangosnippets #1031</a> for ContentType management, so Animal would have a method named <em>as_leaf_class</em> that returns the derived class.</p>
  
  <p>Clearly, one could create forms for each derived class, but that's quite a lot of unnecessary duplication (as the templates will all be generic -- essentially {{ form.as_p }}).</p>
  
  <p>Incidentally, it's best to assume that Animal will probably be one of several unrelated base classes with the same problem, so an ideal solution would be generic.</p>
  
  <p>Thank you in advance for the help.</p>