您好我想在我的django admin中添加一个自定义类,覆盖默认更新,但我不能
class Aprovacao(object):
def __init__(self):
self.tipo = None
self.nome = None
self.data = None
class ServicoAdmin(admin.ModelAdmin):
list_display = ['id', 'descricao', 'porcentagem']
search_fields = ['id', 'descricao']
class PavimentoAdmin(admin.ModelAdmin):
list_display = ['id', 'descricao']
search_fields = ['id', 'descricao']
class AprovacaoAdmin(admin.ModelAdmin):
list_display = ['tipo']
admin.site.register(Servico, ServicoAdmin)
admin.site.register(Pavimento, PavimentoAdmin)
admin.site.register(Aprovacao, AprovacaoAdmin)
为什么?