class CategoryAdmin(admin.ModelAdmin):
list_display = ('name','admins') #admin是外键
def admins(self,obj):
return obj.admins.username
版权声明:本文为qq_37422923原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
class CategoryAdmin(admin.ModelAdmin):
list_display = ('name','admins') #admin是外键
def admins(self,obj):
return obj.admins.username