title: check type in list django templates language
body: <p>I have list has two types of elements let's say wether the element is element A or element B. I pass this list from the backend to the templates. In the templates I will loop for each element and then I would like to check if it is type A do this if it is type B do that. How can I do this type checking?? </p>
  
  <p>To clarify here is a very simple example</p>
  
  <pre><code>Models.py
  class Type_A(models.Model):
  test1 = models.CharField()
  
  class Type_B(models.Model):
  test2 = models.CharField()
  
  
  Views.py 
  c = {}
  l = list()
  l = [Type_A.objects.all(), Type_B.objects.all()]
  c['list'] = shuffle(l)
  return render_to_response('test.html', c , context_instance=RequestContext(request) )
  </code></pre>
  
  <p>test.html
  I am looking for something like this </p>
  
  <pre><code>{% for x in list %}
      {% if x is Type_A %} 
         do this
      {% else %}
         do that
      {% endif %}
  {% endfor %}
  </code></pre>