Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Added HTML 'size' attribute to DateFields and TimeFie…

…lds in the admin, to match previous behavior

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4e1e6722982ab0afc529e7324365bde8ce8477b6 1 parent 03dd1ce
@adrianholovaty adrianholovaty authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/contrib/admin/options.py
View
4 django/contrib/admin/options.py
@@ -213,10 +213,10 @@ def formfield_for_dbfield(self, db_field, **kwargs):
widget=widgets.AdminSplitDateTime(), label=capfirst(db_field.verbose_name), **kwargs)
# For DateFields, add a custom CSS class.
if isinstance(db_field, models.DateField):
- return db_field.formfield(widget=forms.TextInput(attrs={'class': 'vDateField'}))
+ return db_field.formfield(widget=forms.TextInput(attrs={'class': 'vDateField', 'size': '10'}))
# For TimeFields, add a custom CSS class.
if isinstance(db_field, models.TimeField):
- return db_field.formfield(widget=forms.TextInput(attrs={'class': 'vTimeField'}))
+ return db_field.formfield(widget=forms.TextInput(attrs={'class': 'vTimeField', 'size': '8'}))
return db_field.formfield(**kwargs)
def has_add_permission(self, request):
Please sign in to comment.
Something went wrong with that request. Please try again.