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)
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 )
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)
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)
def __init__(self, *args, **kwargs): d = {self.LABEL: kwargs[self.LABEL], self.NAME: kwargs[self.NAME]} SurveyElement.__init__(self, **d)
def __init__(self, *args, **kwargs): d = { self.LABEL : kwargs[self.LABEL], self.NAME : kwargs[self.NAME], } SurveyElement.__init__(self, **d)