newforms-admin AdminDateWidget superclass and DEFAULT_DATE_INPUT_FORMATS
11 views
Skip to first unread message
James Beard
unread,
Feb 12, 2008, 8:25:07 PM2/12/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django developers
Hi all.
I've been having a fun time trying to get the dates in the newforms-
admin app to display dd/mm/YYYY instead of the default YYYY-mm-dd. I
don't want to write custom forms and widgets as the default admin
interface is perfect apart from the way the dates are displayed.
Setting django.newforms.fields.DEFAULT_DATE_INPUT_FORMATS did half the
trick - the object could only be saved with dates in my preferred
format. However, upon refreshing the form they were still rendered
with the default format.
A bit of digging shows contrib.admin.widgets.AdminDateWidget
subclasses forms.TextInput, which doesn't pay any attention to
DEFAULT_DATE_INPUT_FORMATS.
Is there any reason why AdminDateWidget shouldn't subclass
forms.DateTimeInput instead?