How to choose template in DetailView based on a field of the model shown?
Advertisements I have a model with a choice field: type = models.CharField(choices=TYPE_CHOICES, max_length=1, default=UNSET, db_index=True) Depending on the type I’d like to show a different template in the class based DetailView: class AlbumDetailView(DetailView): […] Currently I have set the template by setting: template_name = ‘bilddatenbank/album_detail.html’ But then it’s not possible to access the value of… Read More How to choose template in DetailView based on a field of the model shown?