diff options
Diffstat (limited to 'django/contrib/admin/options.py')
| -rw-r--r-- | django/contrib/admin/options.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 930db7767e..696dd30387 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -94,6 +94,11 @@ class BaseModelAdmin(object): kwargs['widget'] = widgets.AdminIntegerFieldWidget return db_field.formfield(**kwargs) + # For CommaSeparatedIntegerFields, add a custom CSS class. + if isinstance(db_field, models.CommaSeparatedIntegerField): + kwargs['widget'] = widgets.AdminCommaSeparatedIntegerFieldWidget + return db_field.formfield(**kwargs) + # For TextInputs, add a custom CSS class. if isinstance(db_field, models.CharField): kwargs['widget'] = widgets.AdminTextInputWidget |
