试图关注https://github.com/jazzband/django-model-utils/issues/186
#admin.py
class CompanyAdmin(admin.ModelAdmin):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.readonly_fields += (
"created",
"modified",
)
错误
django_1 | SystemCheckError: System check identified some issues:
django_1 |
django_1 | ERRORS:
django_1 | <class 'meetings.admin.CompanyAdmin'>: (admin.E035) The value of 'readonly_fields[0]' is not a callable, an attribute of 'CompanyAdmin', or an attribute of 'meetings.Company'.
django_1 | <class 'meetings.admin.CompanyAdmin'>: (admin.E035) The value of 'readonly_fields[1]' is not a callable, an attribute of 'CompanyAdmin', or an attribute of 'meetings.Company'.
如何created
使用 django-model-utils 在管理面板中显示值?