[docs]classURI(sql_types.TypeDecorator):""" UUID type for reading/writing to the ORM. """impl=sql_types.VARCHAR@propertydefpython_type(self):returnSimDBUrl
[docs]classChoiceType(sql_types.TypeDecorator):impl=sql_types.CHAR@propertydefpython_type(self):returnstrdef__init__(self,choices:Dict[Any,str],enum_type:type,**kw):iftype(enum_type)isnotenum.EnumMeta:raiseValueError("enum_type must be a class inheriting from enum.Enum.")self._enum_type=enum_typeself._choices_inverse=dict(choices)self._choices={v:kfork,vinself._choices_inverse.items()}iflen(self._choices)!=len(self._choices_inverse):raiseTypeError("Values in choices dict must be unique")super().__init__(**kw)