分类:Xadmin
一,为了让xadmin登录者只能看到自己创建的数据1,modelclassUserTB(models.Model):name=models.CharField('姓名',max_length=30,blank=True,null=True)email=models.CharField('邮箱',max_length=200,blank=True,null=True)integral=models.IntegerField('积分',default=0)create_time=models.DateTimeField('创建时间',auto_now_add=True)user=models.OneToOneField(User,blank=True,null=True)#def__unico...
继续阅读 >
2020
10-08
2020
09-25
2020
09-25
课程管理器:classCourseAdmin(object):#设置列表显示字段list_display=['name','course_org','detail','degree','learn_times','students','fav_nums','image','click_nums','add_time']#设置列表查询字段search_field=['name','course_org','detail','degree','learn_times','students','fav_nums','image','click_nums']#设置列表过滤字段list_filter=['name','course_org','detail','degree','lea...
继续阅读 >