2024-02-12 15:13:02 +01:00
|
|
|
from ..util.models import * # pylint: disable=wildcard-import,unused-wildcard-import
|
|
|
|
|
|
|
|
|
|
|
|
class SimpleFlag(XmlModel):
|
|
|
|
XML_TAG = None
|
|
|
|
XML_TAG_FIELD = "flag"
|
|
|
|
|
2024-03-11 09:09:29 +01:00
|
|
|
def __init__(self, flag, **kwargs):
|
|
|
|
super().__init__(flag=flag, **kwargs)
|
2024-02-12 15:13:02 +01:00
|
|
|
|
|
|
|
class SimpleFlagChoices(Enum):
|
|
|
|
ENABLE = "enable"
|
|
|
|
DISABLE = "disable"
|
|
|
|
|
|
|
|
flag: SimpleFlagChoices = Field(
|
|
|
|
xml_wrapped=True,
|
|
|
|
xml_set_tag=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
def __eq__(self, other):
|
|
|
|
if hasattr(other, "flag"):
|
|
|
|
return self.flag == other.flag
|
|
|
|
# allow comparing with a string
|
|
|
|
return self.flag == other
|