Ticket #5609: na2.diff
File na2.diff, 1.9 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/options.py
188 188 return formfield 189 189 190 190 # For any other type of field, just call its formfield() method. 191 return db_field.formfield(**kwargs) 191 formfield = db_field.formfield(**kwargs) 192 # append name to class 193 if formfield: # else a non-editable field 194 attrs = formfield.widget.attrs 195 field_class = 'v%s' % (formfield.__class__.__name__) 196 if attrs.get('class'): # prepend to existing classes 197 field_class += ' %s' % attrs.get('class') 198 attrs['class'] = field_class 199 return formfield 192 200 193 201 def _declared_fieldsets(self): 194 202 if self.fieldsets: -
django/contrib/admin/widgets.py
37 37 settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") 38 38 39 39 def __init__(self, attrs={}): 40 super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10' })40 super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10', 'maxlength': '10'}) 41 41 42 42 class AdminTimeWidget(forms.TextInput): 43 43 class Media: … … 45 45 settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js") 46 46 47 47 def __init__(self, attrs={}): 48 super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8' })48 super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8', 'maxlength': '8'}) 49 49 50 50 class AdminSplitDateTime(forms.SplitDateTimeWidget): 51 51 """