newforms-admin AdminDateWidget superclass and DEFAULT_DATE_INPUT_FORMATS

4 views
Skip to first unread message

James Beard

unread,
Feb 12, 2008, 8:25:07 PM2/12/08
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?

Thanks
James
Reply all
Reply to author
Forward
0 new messages