polychron.models.GroupRelationship
Module
GroupRelationship
Bases: Enum
Enum for the possible types of group relationships
__str__
__str__() -> str
Returns the string representation of the GroupRelationship Enum
Returns:
Type | Description |
---|---|
str
|
the string representation of the RelationShip type Enum |
__eq__
__eq__(other: str | 'GroupRelationship' | Any) -> bool
Custom equality operator
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
str | 'GroupRelationship' | Any
|
The other object to compare to |
required |
Returns:
Type | Description |
---|---|
bool
|
boolean indicating if the objects are consider equal. |
__hash__
__hash__() -> int
Custom hash implementation, which must be overridden when eq is overridden.
Returns: default hash implementation of the underlying string value
from_string
classmethod
from_string(value: str) -> 'GroupRelationship'
Converts a string into a GroupRelationship enum
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
str
|
The string value to convert |
required |
Returns:
Type | Description |
---|---|
'GroupRelationship'
|
The GroupRelationship enum instance |
Raises:
Type | Description |
---|---|
ValueError
|
if the provided string does not match the enum member |