We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5e8ed5 commit 59cb717Copy full SHA for 59cb717
mautrix_telegram/db/portal.py
@@ -62,14 +62,14 @@ def count(cls) -> int:
62
except StopIteration:
63
return 0
64
65
+ @classmethod
66
+ def get_by_mxid(cls, mxid: RoomID) -> Optional['Portal']:
67
+ return cls._select_one_or_none(cls.c.mxid == mxid)
68
+
69
@classmethod
70
def get_by_username(cls, username: str) -> Optional['Portal']:
71
return cls._select_one_or_none(func.lower(cls.c.username) == username)
72
73
74
def all(cls) -> Iterable['Portal']:
- yield from cls._select_all()
-
- @classmethod
- def get_by_mxid(cls, mxid: RoomID) -> Integer:
75
- return cls._select_one_or_none(cls.c.mxid == mxid)
+ yield from cls._select_all()
0 commit comments