Django admin自定义函数报错,TypeError: post_count() missing 1 required positional argument: 'obj'
在学习开发django的时候,碰到了这个问题,源码:@admin.register(Category)classCategoryAdmin(admin.ModelAdmin):defpost_count(self,obj):returnobj.post_set.count()post_count.short_description='文章数量'list_display=('name','statu