Changeset 4204
- Timestamp:
- 12/14/06 23:35:19 (2 years ago)
- Files:
-
- django/trunk/django/newforms/forms.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/newforms/forms.py
r4199 r4204 33 33 return type.__new__(cls, name, bases, attrs) 34 34 35 class Form(StrAndUnicode): 36 "A collection of Fields, plus their associated data." 37 __metaclass__ = DeclarativeFieldsMetaclass 38 35 class BaseForm(StrAndUnicode): 36 # This is the main implementation of all the Form logic. Note that this 37 # class is different than Form. See the comments by the Form class for more 38 # information. Any improvements to the form API should be made to *this* 39 # class, not to the Form class. 39 40 def __init__(self, data=None, auto_id='id_%s', prefix=None): 40 41 self.ignore_errors = data is None … … 169 170 return self.clean_data 170 171 172 class Form(BaseForm): 173 "A collection of Fields, plus their associated data." 174 # This is a separate class from BaseForm in order to abstract the way 175 # self.fields is specified. This class (Form) is the one that does the 176 # fancy metaclass stuff purely for the semantic sugar -- it allows one 177 # to define a form using declarative syntax. 178 # BaseForm itself has no way of designating self.fields. 179 __metaclass__ = DeclarativeFieldsMetaclass 180 171 181 class BoundField(StrAndUnicode): 172 182 "A Field plus data"
