If you have a field with
editable=False
in your model, that field, by default, is hidden in the change page. This also happens with any field marked as auto_now
or auto_now_add
, because that sets the editable=False
on these fields.
If you want these fields to show up on the change page, you can add them to
readonly_fields
.:@admin.register(Villain)
class VillainAdmin(admin.ModelAdmin, ExportCsvMixin):
...
readonly_fields = ["added_on"]
With this change the Villain admin looks like this:
No comments:
Post a Comment