def _from_row(cls, row: asyncpg.Record) -> 'Message': data = {**row} chat_id = data.pop("signal_chat_id") if data["signal_receiver"]: chat_id = Address.parse(chat_id) sender = Address.parse(data.pop("sender")) return cls(signal_chat_id=chat_id, sender=sender, **data)
def _from_row(cls, row: asyncpg.Record) -> 'Reaction': data = {**row} chat_id = data.pop("signal_chat_id") if data["signal_receiver"]: chat_id = Address.parse(chat_id) msg_author = Address.parse(data.pop("msg_author")) author = Address.parse(data.pop("author")) return cls(signal_chat_id=chat_id, msg_author=msg_author, author=author, **data)
def _from_row(cls, row: asyncpg.Record) -> 'Portal': data = {**row} chat_id = data.pop("chat_id") if data["receiver"]: chat_id = Address.parse(chat_id) return cls(chat_id=chat_id, **data)