title: Different content type objects in django template
body: <p>I am having a hard time to understand ContentType. I am learning from a tutorial, this is the <a href="http://ryanberg.net/blog/2008/jun/24/basics-creating-tumblelog-django/" rel="nofollow">link</a>. I have synced the database, and its working in the admin. But when I try to load the ContentType objects in the template, I get nothing. When I see the page source, the <code>get_rendered_method</code> is not loading the rendered template in the homepage.html.</p>
  
  <p>These are my models:</p>
  
  <pre><code>class Photo(models.Model):
      user = models.ForeignKey(User)
      description = models.TextField()
      image = models.ImageField(upload_to=get_upload_file_name)
      photo_upload = models.DateTimeField(auto_now=True, auto_now_add=False)
      is_public = models.BooleanField(default=True)
  
      class Meta:
          verbose_name = 'Photo'
          verbose_name_plural = 'Photos'
          ordering = ['-photo_upload']
  
  class Status(models.Model):
      user = models.ForeignKey(User)
      state = models.CharField(max_length=200)
      status_upload = models.DateTimeField(auto_now=True, auto_now_add=False)
      is_public = models.BooleanField(default=True)
  
  class StreamItem(models.Model):
      content_type = models.ForeignKey(ContentType)
      object_id = models.PositiveIntegerField()
      pub_date = models.DateTimeField()
      content_object = generic.GenericForeignKey('content_type','object_id')
  
      # The get_rendered_html method simply passes the retrieved object to a template with that object’s name
      def get_rendered_html(self):
          template_name = 'stream_item_%s.html' % (self.content_type.name)
          return render(request, template_name, {'object':self.content_object})
  </code></pre>
  
  <p>These are the template for content_type.name:</p>
  
  <p>stream_item_Photo.html:</p>
  
  <pre><code>&lt;div class="si"&gt;
      &lt;img src="{{ object.image }}"&gt;
      &lt;p&gt;{{ object.pub_date|date:"F jS Y, P" }}&lt;/p&gt;
      &lt;p&gt;{{ object.user }}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>stream_item_Status.html:</p>
  
  <pre><code>&lt;div class="si"&gt;
      &lt;p&gt;{{ object.state }}&lt;/p&gt;
      &lt;p&gt;{{ object.time|date:"F jS Y, P" }}&lt;/p&gt;
      &lt;p&gt;User: {{ object.user }}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Where am I doing the mistake? How do I load different content_type objects in the template? I would really appreciate if you could help me solve this. Thank you!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I call the <code>get_rendered_html</code> in the homepage.html. This is homepage.html:</p>
  
  <pre><code>&lt;div class="container"&gt;
    &lt;div class="row"&gt;
        {% for stream_item in stream_item_list %}
            &lt;div class="col-md-4"&gt;
                {{ stream_item.get_rendered_html }}
            &lt;/div&gt;
        {% endfor %}
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>