I have a model with a DateField named pub_date . In the admin panel, I’ve set the widget for this field to use type=month (HTML input type) so that users can select only the year and month (e.g., YYYY-MM ).
The form renders correctly in the admin panel, but when I try to save a new record, Django throws a validation error.
The data from the type=month input doesn’t make it into cleaned_data because Django’s DateField validation fails when it receives a partial date (e.g., YYYY-MM ). As a result, I can’t access or modify the value in the clean_pub_date method or other form cleaning logic.
How can I handle type=month input in Django’s admin panel without causing validation errors?
Is there a way to intercept and modify the raw POST data before Django processes it?