app/soc/views/helper/surveys.py
changeset 2520 859ada69db69
parent 2518 66405056baf8
child 2526 8f29bfb9eb52
--- a/app/soc/views/helper/surveys.py	Fri Jul 03 22:27:42 2009 +0200
+++ b/app/soc/views/helper/surveys.py	Fri Jul 03 22:36:10 2009 +0200
@@ -82,6 +82,7 @@
   def __init__(self, *args, **kwargs):
     """Store special kwargs as attributes.
 
+    params:
       survey_content: a SuveryContent entity.
       survey_logic: instance of SurveyLogic.
       survey_record: a SurveyRecord entity.
@@ -319,7 +320,6 @@
       label: label for field
       tip: tooltip text for field
       comment: initial comment value for field
-
     """
 
     widget = PickManyCheckbox(attrs)
@@ -352,7 +352,6 @@
       label: label for field
       tip: tooltip text for field
       comment: initial comment value for field
-
     """
 
     widget = PickQuantRadio(attrs)
@@ -372,9 +371,17 @@
     self.survey_fields[field] = question
 
   def addCommentField(self, field, comment, attrs, tip):
+    """Add comment field to a question.
+
+    params:
+      field: the name of the field to add the comment field to
+      comment: the initial value of this field.
+      attrs: the attrs for the widget
+      tip: tooltip text for this field
+    """
     widget = widgets.Textarea(attrs=attrs)
     comment_field = CharField(help_text=tip, required=False, label='Comments',
-                        widget=widget, initial=comment)
+                              widget=widget, initial=comment)
     self.survey_fields[COMMENT_PREFIX + field] = comment_field
 
 
@@ -397,6 +404,7 @@
   def __init__(self, *args, **kwargs):
     """Store special kwargs as attributes.
 
+    params:
       survey_content: a SurveyContent entity.
       survey_logic: an instance of SurveyLogic.
     """
@@ -440,7 +448,6 @@
 
       kwargs['widget'] = schema.getEditWidget(field, extra_attrs)
 
-
       # add new field
       self.survey_fields[field] = schema.getEditField(field)(**kwargs)
 
@@ -612,7 +619,6 @@
     self.is_required = is_required
     self.has_comment = has_comment
 
-
   def render(self, name, value, attrs=None, choices=()):
     """Render UCE widget.
 
@@ -691,7 +697,6 @@
     params:
       is_required: bool, controls selection in the 'required' extra field
       has_comments: bool, controls selection in the 'has_comment' extra field
-      editing: bool, controls rendering as plain textarea or with extra fields
     """
 
     self.is_required = is_required
@@ -729,7 +734,6 @@
     params:
       is_required: bool, controls selection in the 'required' extra field
       has_comments: bool, controls selection in the 'has_comment' extra field
-      editing: bool, controls rendering as plain text input or with extra fields
     """
 
     self.is_required = is_required