Python 如何访问django管理类中的模型方法
我有一个这样的代理模型Python 如何访问django管理类中的模型方法,python,django,Python,Django,我有一个这样的代理模型 class Category(GenericCategory): class Meta: proxy = True verbose_name = "Category" verbose_name_plural = "Categories" @property def get_content_type(self): return ContentTy
class Category(GenericCategory):
class Meta:
proxy = True
verbose_name = "Category"
verbose_name_plural = "Categories"
@property
def get_content_type(self):
return ContentType.objects.get_for_model(
self.__class__, for_concrete_model=False
)
现在我想访问django admin类中的get_content_type方法,以便在django admin中过滤数据