class GlobalSetting(object): site_title = u'xxx后台' def kuF_site_menu(self): return [{ 'title': u'用户&账户', 'perm': self.get_model_perm(User, 'view'), 'icon':'fa fa-users', 'menus':( {'title': u'用户', 'url': self.get_model_url(User, 'changelist')}, {'title': u'账户', 'url': self.get_model_url(Account, 'changelist'), 'perm': self.get_model_perm(Account, 'view'), }, {'title': u'用户套餐', 'url': self.get_model_url(AccountLogs, 'changelist'), 'perm': self.get_model_perm(AccountLogs, 'view'), }, ) }, ] def get_site_menu(self): menus = [] from xxx_app.adminx import card_pool_site_menu menus.extend(card_pool_site_menu(self)) menus.extend(self.kuF_site_menu()) return menus xadmin.site.register(CommAdminView, GlobalSetting)