标签:class tags horizon erp date lan play color ima
1 添加用户
2 给予对表的权限
3. 修改中文名
每个类都要修改
class Meta(): verbose_name = "校区" verbose_name_plural = "校区"
4.admin 设置
class CustomerAdmin(admin.ModelAdmin): list_display = (‘id‘,‘qq‘,‘source‘,‘consultant‘,‘content‘,‘status‘,‘date‘) list_filter = (‘source‘,‘consultant‘,‘date‘) search_fields = (‘qq‘,‘name‘) raw_id_fields = (‘consult_course‘,) filter_horizontal = (‘tags‘,) list_editable = (‘status‘,) class UserProfileAdmin(admin.ModelAdmin): list_display = (‘user‘,‘name‘)
在admin.py也要修改Custmoer,和 UserProfile
admin.site.register(models.Customer,CustomerAdmin)
admin.site.register(models.UserProfile,UserProfileAdmin)
tags = models.ManyToManyField("Tag",blank=True,null=True) #标签 多对多 status_choice = ((0,‘已报名‘), (1,‘未报名‘), ) status = models.SmallIntegerField(choices=status_choice,default=1)
标签:class tags horizon erp date lan play color ima
原文地址:http://www.cnblogs.com/venicid/p/7784526.html