标签: python django
我有以下模型类:
class ItemInstance(models.Model): TITLE = 0 COLLECTION = 1 TVSERIES = 2
这允许我这样做:
item = ItemInstance.objects.all()[0] item.TITLE ==> 0
但不是这样:
cls = ItemInstance cls.TITLE ==> error
如何为vars启用这些@classmethod?
vars
@classmethod