Esempio n. 1
0
    def validate(self):
        SurveyElement.validate(self)

        # make sure that the type of this question exists in the
        # question type dictionary.
        if self.type not in QUESTION_TYPE_DICT:
            raise PyXFormError("Unknown question type '%s'." % self.type)
Esempio n. 2
0
    def validate(self):
        SurveyElement.validate(self)

        # make sure that the type of this question exists in the
        # question type dictionary.
        if self.type not in QUESTION_TYPE_DICT:
            raise PyXFormError(
                "Unknown question type '%s'." % self.type
                )
Esempio n. 3
0
 def __init__(self, *args, **kwargs):
     if self.MEDIA in kwargs:
         d = {
             self.LABEL: kwargs[self.LABEL],
             self.MEDIA: kwargs[self.MEDIA],
             self.NAME: unicode(kwargs[self.NAME]),
             }
     else:
         d = {
             self.LABEL: kwargs[self.LABEL],
             self.NAME: unicode(kwargs[self.NAME]),
             }
     SurveyElement.__init__(self, **d)
Esempio n. 4
0
 def get(self, key):
     """
     Overlay this questions binding attributes on type of the
     attributes from this question type.
     """
     question_type_dict = self.get_type_definition()
     under = question_type_dict.get(key, None)
     over = SurveyElement.get(self, key)
     if not under: return over
     return _overlay(over, under)
Esempio n. 5
0
 def get(self, key):
     """
     Overlay this questions binding attributes on type of the
     attributes from this question type.
     """
     question_type_dict = self.get_type_definition()
     under = question_type_dict.get(key, None)
     over = SurveyElement.get(self, key)
     if not under:
         return over
     return _overlay(over, under)
Esempio n. 6
0
 def __init__(self, *args, **kwargs):
     d = {self.LABEL: kwargs[self.LABEL], self.NAME: kwargs[self.NAME]}
     SurveyElement.__init__(self, **d)
Esempio n. 7
0
 def __init__(self, *args, **kwargs):
     d = {
         self.LABEL : kwargs[self.LABEL],
         self.NAME : kwargs[self.NAME],
         }
     SurveyElement.__init__(self, **d)