diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 2071792bdb..3b899e552a 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -49,7 +49,7 @@ FORMFIELD_FOR_DBFIELD_DEFAULTS = { models.TextField: {'widget': widgets.AdminTextareaWidget}, models.URLField: {'widget': widgets.AdminURLFieldWidget}, models.IntegerField: {'widget': widgets.AdminIntegerFieldWidget}, - models.BigIntegerField: {'widget': widgets.AdminIntegerFieldWidget}, + models.BigIntegerField: {'widget': widgets.AdminBigIntegerFieldWidget}, models.CharField: {'widget': widgets.AdminTextInputWidget}, models.ImageField: {'widget': widgets.AdminFileWidget}, models.FileField: {'widget': widgets.AdminFileWidget}, diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index 9d39b3fe89..efec04b670 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -226,6 +226,10 @@ body.popup .submit-row { width: 5em; } +.vBigIntegerField { + width: 10em; +} + .vForeignKeyRawIdAdminField { width: 5em; } diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py index 29958b27a4..980863ed84 100644 --- a/django/contrib/admin/widgets.py +++ b/django/contrib/admin/widgets.py @@ -303,12 +303,17 @@ class AdminURLFieldWidget(forms.TextInput): super(AdminURLFieldWidget, self).__init__(attrs=final_attrs) class AdminIntegerFieldWidget(forms.TextInput): + class_name = 'vIntegerField' + def __init__(self, attrs=None): - final_attrs = {'class': 'vIntegerField'} + final_attrs = {'class': self.class_name} if attrs is not None: final_attrs.update(attrs) super(AdminIntegerFieldWidget, self).__init__(attrs=final_attrs) +class AdminBigIntegerFieldWidget(AdminIntegerFieldWidget): + class_name = 'vBigIntegerField' + class AdminCommaSeparatedIntegerFieldWidget(forms.TextInput): def __init__(self, attrs=None): final_attrs = {'class': 'vCommaSeparatedIntegerField'}