Пример #1
0
    def verificate(self):
        for k, attr in self.__attributes__.items():
            if not isinstance(self._storage.get(k, Attribute._DefaultNone()), Attribute._DefaultNone):
                continue

            if not isinstance(attr.default, Attribute._DefaultNone):
                continue

            if isinstance(attr, ModelAttribute) and attr.is_id_alias:
                continue

            raise ValueError(f"Set {self.__class__.__name__}.{k}")
        return True
Пример #2
0
 def __init__(self, description: Optional[str] = None,
              default: Any = Attribute._DefaultNone(),
              uid: bool = False,
              method=None):
     self.name = None
     super().__init__(description, default, uid, method=method)