mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-11 05:17:55 +03:00
Added some comments on __eq__ operator of ObjectType
This commit is contained in:
parent
efd78ddffb
commit
31ffcfaf4b
@ -80,6 +80,7 @@ class Permissions(Handler):
|
||||
perms: typing.Iterable[models.Permissions],
|
||||
) -> typing.List[typing.Dict[str, str]]:
|
||||
res = []
|
||||
entity: typing.Optional[typing.Union[models.User, models.Group]]
|
||||
for perm in perms:
|
||||
if perm.user is None:
|
||||
kind = 'group'
|
||||
|
@ -80,7 +80,7 @@ class ObjectType(enum.Enum):
|
||||
|
||||
@property
|
||||
def type(self) -> int:
|
||||
"""Returns the integer value of this object type"""
|
||||
"""Returns the integer value of this object type. (The "type" id)"""
|
||||
return self.value.type
|
||||
|
||||
@staticmethod
|
||||
@ -98,5 +98,15 @@ class ObjectType(enum.Enum):
|
||||
|
||||
Returns:
|
||||
bool: True if equal, False otherwise
|
||||
|
||||
Examples:
|
||||
>>> ObjectType.PROVIDER == ObjectType.PROVIDER
|
||||
True
|
||||
>>> ObjectType.PROVIDER == 1
|
||||
True
|
||||
>>> ObjectType.PROVIDER == ObjectType.SERVICE
|
||||
False
|
||||
>>> ObjectType.PROVIDER == 2
|
||||
False
|
||||
"""
|
||||
return super().__eq__(__o) or self.value[0] == __o
|
||||
return super().__eq__(__o) or self.value.type == __o
|
||||
|
Loading…
Reference in New Issue
Block a user