CRM项目实战-kingadmin model obj list 页面开发
Posted jintian
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CRM项目实战-kingadmin model obj list 页面开发相关的知识,希望对你有一定的参考价值。
from kingadmin.admin_base import BaseKingAdmin class AdminSite(object): def __init__(self): self.enabled_admins = def register(self,model_class,admin_class=None): """注册admin表""" #print("register",model_class,admin_class) app_name = model_class._meta.app_label model_name = model_class._meta.model_name if not admin_class: #为了避免多个model共享同一个BaseKingAdmin内存对象 admin_class = BaseKingAdmin() else: admin_class = admin_class() admin_class.model = model_class #把model_class赋值给了admin_class if app_name not in self.enabled_admins: self.enabled_admins[app_name] = self.enabled_admins[app_name][model_name] = admin_class site = AdminSite()
以上是关于CRM项目实战-kingadmin model obj list 页面开发的主要内容,如果未能解决你的问题,请参考以下文章
CRM项目实战-kingadmin+admin+action功能开发