If I have a list of objects that require similar layouts but need some attribute set based on the class of object how can I go about getting the class name while class>
A little dirty solution
If objects is a QuerySet that belong to a model, you can add a custom method to your model.
class mymodel(models.Model): foo = models........ def get_cname(self): class_name = .... return class_name
then in your template you can try:
{% for obj in objects %} .. {% endfor }}