Ticket #7656: patch_django_7656.20090209.diff
File patch_django_7656.20090209.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/widgets.py
39 39 (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX)) 40 40 return mark_safe(u''.join(output)) 41 41 42 class AdminDateWidget(forms.TextInput): 42 class AdminDateWidget(forms.DateTimeInput): 43 format = getattr(settings, 'ADMIN_DATE_FORMAT', '%Y-%m-%d') 44 43 45 class Media: 44 46 js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js", 45 47 settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") 46 48 47 def __init__(self, attrs={} ):48 super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10'} )49 def __init__(self, attrs={}, format=None): 50 super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10'}, format=format) 49 51 50 class AdminTimeWidget(forms.TextInput): 52 class AdminTimeWidget(forms.TimeInput): 53 51 54 class Media: 52 55 js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js", 53 56 settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js")