Hi everyone, first time posting in the forum.
I’m here as suggested by @sarahboyce, looking forward to hearing your feedback on a feature suggestion for the contrib.admin module. In particular, as the title reads, regarding the ability to customize the read_only representation of model admin fields based on their type, without relying on the manually specified, explicit read_only parameter of widgets which only works if explicitly set in the admin form. Instead, I’d like to set a read_only representation only based on the type of the field, which in my example is DateTimeField.
Here is the link of the comment that got me posting here:
https://code.djangoproject.com/ticket/30577#comment:10
You can read through the thread to better understand the issue, and you will find a link to my PoC of a possible solution.
Here is the link to an actual workaround/monkeypatch ugly and full of problems that Django forced me to write to overcome the issue in my open source project:
The same code is present in my PoC from the aforementioned thread: GitHub - ldeluigi/django-poc-20240610
Let me know what you think and if there is a better way to achieve what I want, without explicitly writing custom forms with custom widgets for every single ocurrence of that field type in any admin form. Thanks for the attention!