From acd7b34aafe352ef604edcb73f75041c5cbba6b9 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 29 Jun 2013 18:34:41 +0200 Subject: Advanced deprecation warnings for Django 1.7. --- django/forms/forms.py | 2 +- django/forms/models.py | 6 +++--- django/forms/widgets.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'django/forms') diff --git a/django/forms/forms.py b/django/forms/forms.py index b25eeb30a4..6d59271d17 100644 --- a/django/forms/forms.py +++ b/django/forms/forms.py @@ -352,7 +352,7 @@ class BaseForm(object): if hasattr(field.widget, '_has_changed'): warnings.warn("The _has_changed method on widgets is deprecated," " define it at field level instead.", - PendingDeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=2) if field.widget._has_changed(initial_value, data_value): self._changed_data.append(name) elif field._has_changed(initial_value, data_value): diff --git a/django/forms/models.py b/django/forms/models.py index 821f64199b..a0c3009d38 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -260,7 +260,7 @@ class ModelFormMetaclass(type): warnings.warn("Creating a ModelForm without either the 'fields' attribute " "or the 'exclude' attribute is deprecated - form %s " "needs updating" % name, - PendingDeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=2) if opts.fields == ALL_FIELDS: # sentinel for fields_for_model to indicate "get the list of @@ -513,7 +513,7 @@ def modelform_factory(model, form=ModelForm, fields=None, exclude=None, getattr(Meta, 'exclude', None) is None): warnings.warn("Calling modelform_factory without defining 'fields' or " "'exclude' explicitly is deprecated", - PendingDeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=2) # Instatiate type(form) in order to use the same metaclass as form. return type(form)(class_name, (form,), form_class_attrs) @@ -796,7 +796,7 @@ def modelformset_factory(model, form=ModelForm, formfield_callback=None, getattr(meta, 'exclude', exclude) is None): warnings.warn("Calling modelformset_factory without defining 'fields' or " "'exclude' explicitly is deprecated", - PendingDeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=2) form = modelform_factory(model, form=form, fields=fields, exclude=exclude, formfield_callback=formfield_callback, diff --git a/django/forms/widgets.py b/django/forms/widgets.py index 38d1b99b0d..a92e5a56ce 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -636,7 +636,7 @@ class RadioChoiceInput(ChoiceInput): class RadioInput(RadioChoiceInput): def __init__(self, *args, **kwargs): msg = "RadioInput has been deprecated. Use RadioChoiceInput instead." - warnings.warn(msg, PendingDeprecationWarning, stacklevel=2) + warnings.warn(msg, DeprecationWarning, stacklevel=2) super(RadioInput, self).__init__(*args, **kwargs) -- cgit v1.3