James Crasta  committed 7514e8c

ext.django: Remove deprecated label_attr parameter

  • Participants
  • Parent commits 9f77dba

Comments (0)

Files changed (2)

File wtforms/ext/django/

     widget = widgets.Select()
-    def __init__(self, label=None, validators=None, queryset=None, get_label=None, label_attr=None, allow_blank=False, blank_text=u'', **kwargs):
+    def __init__(self, label=None, validators=None, queryset=None, get_label=None, allow_blank=False, blank_text=u'', **kwargs):
         super(QuerySetSelectField, self).__init__(label, validators, **kwargs)
         self.allow_blank = allow_blank
         self.blank_text = blank_text
         if queryset is not None:
             self.queryset = queryset.all() # Make sure the queryset is fresh
-        if label_attr is not None:
-            warnings.warn('label_attr= will be removed in WTForms 0.7, use get_label= instead.', DeprecationWarning)
-            self.get_label = operator.attrgetter(label_attr)
-        elif get_label is None:
+        if get_label is None:
             self.get_label = lambda x: x
         elif isinstance(get_label, basestring):
             self.get_label = operator.attrgetter(get_label)

File wtforms/

     Validates that the field contains data. This validator will stop the
     validation chain on error.
+    If the data is empty, also removes prior errors (such as processing errors)
+    from the field.
     :param message:
         Error message to raise in case of a validation error.