How to show created in admin panel from TimeStampedModel

  django-admin, django-model-utils, python-3.x

trying to follow 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",
        )

error

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'.

How do you show the created value in the admin panel with django-model-utils ?

Source: Python-3x Questions

LEAVE A COMMENT