From adf4b9311d5d64a2bdd58da50271c121ea22e397 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Mon, 19 Jun 2006 15:23:57 +0000 Subject: multi-auth: Merged to [3151] git-svn-id: http://code.djangoproject.com/svn/django/branches/multi-auth@3152 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/__init__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'django/forms') diff --git a/django/forms/__init__.py b/django/forms/__init__.py index cea3d22310..fab7a6da7a 100644 --- a/django/forms/__init__.py +++ b/django/forms/__init__.py @@ -101,7 +101,7 @@ class Manipulator(object): for field in self.fields: field.convert_post_data(new_data) -class FormWrapper: +class FormWrapper(object): """ A wrapper linking a Manipulator to the template system. This allows dictionary-style lookups of formfields. It also handles feeding @@ -150,7 +150,7 @@ class FormWrapper: fields = property(_get_fields) -class FormFieldWrapper: +class FormFieldWrapper(object): "A bridge between the template system and an individual form field. Used by FormWrapper." def __init__(self, formfield, data, error_list): self.formfield, self.data, self.error_list = formfield, data, error_list @@ -211,7 +211,7 @@ class FormFieldCollection(FormFieldWrapper): def html_combined_error_list(self): return ''.join([field.html_error_list() for field in self.formfield_dict.values() if hasattr(field, 'errors')]) -class InlineObjectCollection: +class InlineObjectCollection(object): "An object that acts like a sparse list of form field collections." def __init__(self, parent_manipulator, rel_obj, data, errors): self.parent_manipulator = parent_manipulator @@ -269,7 +269,7 @@ class InlineObjectCollection: self._collections = collections -class FormField: +class FormField(object): """Abstract class representing a form field. Classes that extend FormField should define the following attributes: @@ -613,9 +613,10 @@ class CheckboxSelectMultipleField(SelectMultipleField): back into the single list that validators, renderers and save() expect. """ requires_data_list = True - def __init__(self, field_name, choices=None, validator_list=None): + def __init__(self, field_name, choices=None, ul_class='', validator_list=None): if validator_list is None: validator_list = [] if choices is None: choices = [] + self.ul_class = ul_class SelectMultipleField.__init__(self, field_name, choices, size=1, is_required=False, validator_list=validator_list) def prepare(self, new_data): @@ -628,7 +629,7 @@ class CheckboxSelectMultipleField(SelectMultipleField): new_data.setlist(self.field_name, data_list) def render(self, data): - output = ['