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 bit simpler; assuming your layout is a list of a single model:
class ObjectListView(ListView): model = Person template_name = 'object_list.html' def model_name(self): return self.model._meta.verbose_name
Then in object_list.html:
object_list.html
{% for obj in object_list %} ... {% endfor }}