I have a table whose primary key is a DateField.
For a number of reasons I have been using Django 1.7 (slightly modified for Python 3.x). In this version the admin interface for this table worked properly (for both MSSQL 2008 R2, and PostgreSQL 14 databases).
However after upgrading to Django 4.2 and 5.0 (both versions) on PostgreSQL 14, while displaying this table in the admin interface works, trying to delete a row fails in the following way.
After selecting the row to be deleted, I get the correct prompt
Are you sure?
Are you sure you want to delete the selected opd open date? All of the following objects and their related items will be deleted:
Summary
- Opd open dates: 1
Objects
- Opd open date: OPD Open on 2023-12-25
Answering the question in the affirmative, I then get the following error.
ValidationError at /hmis/admin/billing/opdopendate/
[‘“Dec. 25, 2023” value has an invalid date format. It must be in YYYY-MM-DD format.’]
Request Method: | POST |
---|---|
Request URL: | http://127.0.0.1:8082/hmis/admin/billing/opdopendate/ |
Django Version: | 5.0 |
Exception Type: | ValidationError |
Exception Value: | [‘“Dec. 25, 2023” value has an invalid date format. It must be in YYYY-MM-DD format.’] |
Exception Location: | /home/myuser/dj4/lib/python3.10/site-packages/django/db/models/fields/init.py, line 1486, in to_python |
Raised during: | django.contrib.admin.options.changelist_view |
Python Version: | 3.10.13 |
Python Path: | [‘/code’, ‘/usr/local/lib/python310.zip’, ‘/usr/local/lib/python3.10’, ‘/usr/local/lib/python3.10/lib-dynload’, ‘/home/myuser/dj4/lib/python3.10/site-packages’] |
Server time: | Fri, 08 Dec 2023 09:26:09 +0545 |