标签:erp 用户 too 超级用户 技术 make def ati shu
import xadmin from xadmin import views from .models import UserProfile,PianQu,LouMing,DanYuan,ZhuHu,UserToZhuHu class BaseSetting(object): enable_themes = True use_bootswatch = True class GlobalSettings(object): site_title = "新中街社区网格化治理信息平台" site_footer = "赤峰市落忆网络科技有限公司" menu_style = "accordion" class UserProfileAdmin(object): list_display = ["username","name","minzu","sex","mobile","address","danwei","is_dangyuan","hujixz","huji","wenhua", "hunyin","no","chusheng","is_teshu","teshu","beizhu","power"] list_filter = ["username","name","minzu","sex","mobile","address","danwei","is_dangyuan","hujixz","huji","wenhua", "hunyin","no","chusheng","is_teshu","teshu","beizhu","power"] search_fields = ["username","name","minzu","sex","mobile","address","danwei","is_dangyuan","hujixz","huji","wenhua", "hunyin","no","is_teshu","teshu","beizhu","power"] class PianQuAdmin(object): list_display = ["image_url","name","wgz","add_time"] list_filter = ["name","wgz","add_time"] search_fields = ["name"] class LouMingAdmin(object): list_display = ["name","pianqu","wgy","add_time"] list_filter = ["name","pianqu","wgy","add_time"] search_fields = ["name"] class DanYuanAdmin(object): list_display = ["name","lou","dyz","add_time"] list_filter = ["name","lou","dyz","add_time"] search_fields = ["name"] class ZhuHuAdmin(object): list_display = ["name", "dy", "hz", "add_time"] list_filter = ["name", "dy", "hz", "add_time"] search_fields = ["name"] class UserToZhuHuAdmin(object): list_display = ["user", "zhhu", "add_time"] list_filter = ["user", "zhhu", "add_time"] # 先注销模块,再注册 xadmin.site.unregister(UserProfile) xadmin.site.register(UserProfile, UserProfileAdmin) xadmin.site.register(views.BaseAdminView, BaseSetting) xadmin.site.register(views.CommAdminView, GlobalSettings) xadmin.site.register(PianQu, PianQuAdmin) xadmin.site.register(LouMing, LouMingAdmin) xadmin.site.register(DanYuan, DanYuanAdmin) xadmin.site.register(ZhuHu, ZhuHuAdmin) xadmin.site.register(UserToZhuHu, UserToZhuHuAdmin)
2.在apps/goods下新建adminx.py:
备用
3.在apps/trade下新建adminx.py:
备用
4.在apps/user_operations下新建adminx.py:
import xadmin from .models import Notice class NoticeAdmin(object): list_display = ["user","content","add_time"] list_filter = ["user","content","add_time"] search_fields=["content"] xadmin.site.register(Notice,NoticeAdmin)
pip --default-timeout=100 install django-crispy-forms pip --default-timeout=100 install django-reversion pip --default-timeout=100 install django-formtools pip --default-timeout=100 install future pip --default-timeout=100 install httplib2 pip --default-timeout=100 install six pip --default-timeout=100 install django-import-export
pip --default-timeout=100 install xlwt
pip --default-timeout=100 install xlsxwriter
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser Username: root 邮箱: 1@1.com Password: Password (again):
LANGUAGE_CODE = ‘zh-hans‘ TIME_ZONE = ‘Asia/Shanghai‘ USE_I18N = True USE_L10N = True USE_TZ = False
1.在apps/users/apps.py中:
from django.apps import AppConfig class UsersConfig(AppConfig): name = ‘users‘ verbose_name=‘用户‘
2.在apps/goods/apps.py中:
from django.apps import AppConfig class GoodsConfig(AppConfig): name = ‘goods‘ verbose_name=‘商品服务‘
3.在apps/trade/apps.py中:
from django.apps import AppConfig class TradeConfig(AppConfig): name = ‘trade‘ verbose_name=‘交易‘
4.在apps/user_operations/apps.py中:
from django.apps import AppConfig class UserOperationsConfig(AppConfig): name = ‘user_operations‘ verbose_name=‘用户操作‘
标签:erp 用户 too 超级用户 技术 make def ati shu
原文地址:https://www.cnblogs.com/xuepangzi/p/13074276.html