app/soc/views/helper/surveys.py
changeset 3069 1b9c554ca96d
parent 2798 ec1857f0d0c7
child 3070 afd98e17a2b2
equal deleted inserted replaced
3068:1e01ffe9cc61 3069:1b9c554ca96d
   801   """
   801   """
   802 
   802 
   803   def __init__(self, *args, **kwargs):
   803   def __init__(self, *args, **kwargs):
   804     super(PickManyField, self).__init__(*args, **kwargs)
   804     super(PickManyField, self).__init__(*args, **kwargs)
   805 
   805 
       
   806   def clean(self, value):
       
   807     """Validates that the input is a list or tuple. If no fields are marked,
       
   808     an empty string is returned istead of an empty list.
       
   809     """
       
   810     
       
   811     value = super(PickManyField, self).clean(value)
       
   812     return value if value else ''
       
   813 
   806 
   814 
   807 class PickQuantField(forms.ChoiceField):
   815 class PickQuantField(forms.ChoiceField):
   808   """Stub for customizing the choice field.
   816   """Stub for customizing the choice field.
   809   """
   817   """
   810 
   818