diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-07-01 04:24:20 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-07-01 04:24:20 +0000 |
| commit | acf0ff02e78105c67d2a66c7c898f572ae84fdc0 (patch) | |
| tree | 31f8cd24daed3be2e47e808e7954283392f93e6e /django/newforms/fields.py | |
| parent | 510e545776468ee0d546c1d57ca668a53d261ca6 (diff) | |
Added some clearer docstrings to MultiValueField and MultiWidget
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/fields.py')
| -rw-r--r-- | django/newforms/fields.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py index 167281a061..cec2ae8317 100644 --- a/django/newforms/fields.py +++ b/django/newforms/fields.py @@ -482,17 +482,18 @@ class ComboField(Field): class MultiValueField(Field): """ - A Field that is composed of multiple Fields. - - Its clean() method takes a "decompressed" list of values. Each value in + A Field that aggregates the logic of multiple Fields. + + Its clean() method takes a "decompressed" list of values, which are then + cleaned into a single value according to self.fields. Each value in this list is cleaned by the corresponding field -- the first value is cleaned by the first field, the second value is cleaned by the second field, etc. Once all fields are cleaned, the list of clean values is "compressed" into a single value. - Subclasses should implement compress(), which specifies how a list of - valid values should be converted to a single value. Subclasses should not - have to implement clean(). + Subclasses should not have to implement clean(). Instead, they must + implement compress(), which takes a list of valid values and returns a + "compressed" version of those values -- a single value. You'll probably want to use this with MultiWidget. """ |
