def get_type(self):
        t = self.sameas().type
        if t == 'custom':
            cd = self.sameas().getcheckdict()
            if 'type' not in cd:
                raise Exception("When using custom types, you must have type=<name> in the additional checks field")
            return cd.get('type')
        return t
Get the type name, treating sameas and custom specially
dataset/ETHPy150Open seantis/seantis-questionnaire/questionnaire/models.py/Question.get_type