Ticket #7656: patch_django_7656.20090207.diff
File patch_django_7656.20090207.diff, 1.6 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.DateTimeInput): 53 format = getattr(settings, 'ADMIN_TIME_FORMAT', '%H:%M:%S') 54 51 55 class Media: 52 56 js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js", 53 57 settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") 54 58 55 def __init__(self, attrs={} ):56 super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8'} )59 def __init__(self, attrs={}, format=None): 60 super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8'}, format=format) 57 61 58 62 class AdminSplitDateTime(forms.SplitDateTimeWidget): 59 63 """