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)