Open FXC-ai opened 1 month ago
The auto_now_add field inherit editable=False so it does not show in the admin panel. To show it, add readonly_fields in the admin.py of the model with the field to be shown (ex: readonly_fields = (’field_name’)) https://docs.djangoproject.com/en/5.0/ref/models/fields/#django.db.models.DateField.auto_now_add
auto_now_add
editable=False
readonly_fields
admin.py
readonly_fields = (’field_name’)
The
auto_now_add
field inheriteditable=False
so it does not show in the admin panel. To show it, addreadonly_fields
in theadmin.py
of the model with the field to be shown (ex:readonly_fields = (’field_name’)
) https://docs.djangoproject.com/en/5.0/ref/models/fields/#django.db.models.DateField.auto_now_add