Commits

Anonymous committed 428b792

_IterableOptions -> SelectFieldBase. Also, ext.django.fields get some love as well.

  • Participants
  • Parent commits cf9ac60

Comments (0)

Files changed (3)

File wtforms/ext/django/fields.py

 Useful form fields for use with the Django ORM.
 """
 from wtforms import widgets
-from wtforms.fields import Field
+from wtforms.fields import SelectFieldBase
 from wtforms.validators import ValidationError
 
 
 )
 
 
-class QuerySetSelectField(Field):
+class QuerySetSelectField(SelectFieldBase):
     """
     Given a QuerySet either at initialization or inside a view, will display a
     select drop-down field of choices. The `data` property actually will

File wtforms/ext/sqlalchemy/fields.py

 import warnings
 
 from wtforms import widgets
-from wtforms.fields import _IterableOptions
+from wtforms.fields import SelectFieldBase
 from wtforms.validators import ValidationError
 
 try:
 )
 
 
-class QuerySelectField(_IterableOptions):
+class QuerySelectField(SelectFieldBase):
     """
     Will display a select drop-down field to choose between ORM results in a
     sqlalchemy `Query`.  The `data` property actually will store/keep an ORM

File wtforms/fields.py

         return 'Label(%r, %r)' % (self.field_id, self.text)
 
 
-class _IterableOptions(Field):
+class SelectFieldBase(Field):
     """
     Base class for fields which can be iterated to produce options.
 
     provide this functionality.
     """
     def __init__(self, label=u'', validators=None, option_widget=None, **kwargs):
-        super(_IterableOptions, self).__init__(label, validators, **kwargs)
+        super(SelectFieldBase, self).__init__(label, validators, **kwargs)
 
         if option_widget is not None:
             self.option_widget = option_widget
             return self.data
 
 
-class SelectField(_IterableOptions):
+class SelectField(SelectFieldBase):
     widget = widgets.Select()
     option_widget = widgets.Option()