Skip to content

Instantly share code, notes, and snippets.

@naturalwarren
Last active April 8, 2023 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naturalwarren/2a24c3de70068f8d564143533b62fea8 to your computer and use it in GitHub Desktop.
Save naturalwarren/2a24c3de70068f8d564143533b62fea8 to your computer and use it in GitHub Desktop.
SDUI UI Base Component Type
class UIComponent(BaseModel, ABC):
sdui_component_type: ComponentType
def __init__(self, **data) -> None:
data['sdui_component_type'] = self.component_type()
super().__init__(**data)
@classmethod
@abstractmethod
def component_type(cls) -> ComponentType:
"""
Returns a unique case in the ComponentType enum
"""
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment