class Book(models.Model): [..] def class_name(self): return self.__class__.__name__
Thus, whenever you call book.class_name (also in the template {{book.class_name}} ), it returns the name of the class, which is the "Book".
Brkyrn Jan 30 '17 at 11:25 2017-01-30 11:25
source share