title: how to extend django views/templates in a forward looking way
body: <p>i'm looking for a way to extend a django template/view.</p>
  
  <p>my first implementation consists of two models (<code>clients/models.py</code>):</p>
  
  <pre><code>class Client(models.Model):
      ...
  
  class Address(models.Model):
      client = models.ForeignKey(Client)
      ...
  </code></pre>
  
  <p>and its fairly simple template (<code>clients/detail.html</code>) :</p>
  
  <pre><code>{{client.name}}
  Address: {{client.address.street}}, {{client.address.zipcode}} {{client.address.city}}
  </code></pre>
  
  <p>as my application grows, a new app was born: 'invoices'.</p>
  
  <p>it is again very simple (<code>invoices/models.py</code>):</p>
  
  <pre><code>class Invoice(models.Model):
      client = models.ForeignKey(clients.models.Client)
      ...
  </code></pre>
  
  <p>now my clients details-view needs to display invoices, so i create and override <code>clients/detail.html</code> in my 'invoices' app.</p>
  
  <p>good for now.</p>
  
  <p>later on i created a third app 'quotes'.
  again my clients details-view needs to display quotes.</p>
  
  <p>if i create <code>clients/detail.html</code> in my 'clients' i will loose the ability to display invoices.</p>
  
  <p>because the 'invoices' and 'quotes' app are indipendent.</p>
  
  <p>my first idea was to create something like a SubView-class
  which 'invoices' and 'quotes' can extend and then register their implementation somewhere.</p>
  
  <p>a template should look like this: </p>
  
  <pre><code>{{client.name}}
  Address: {{client.address.street}}, {{client.address.zipcode}} {{client.address.city}}
  
  {% for view in views %}
      &lt;h1&gt;{{view.title}}&lt;/h1&gt;
      {{view.get_html}}
  {% endfor %}
  </code></pre>
  
  <p>is this a good way to go and should i use a <code>admin.site</code>-like implementation for registering my sub-views?</p>