lnbits-legend/lnbits/extensions/usermanager/models.py

24 lines
368 B
Python
Raw Normal View History

2020-05-01 06:09:51 +01:00
from typing import NamedTuple
2021-04-21 14:02:52 +01:00
from sqlite3 import Row
2020-05-01 06:09:51 +01:00
2020-08-30 23:19:43 -03:00
2020-05-01 06:09:51 +01:00
class Users(NamedTuple):
id: str
name: str
admin: str
email: str
password: str
2020-08-30 23:19:43 -03:00
2020-05-01 06:09:51 +01:00
class Wallets(NamedTuple):
id: str
admin: str
name: str
user: str
adminkey: str
inkey: str
2021-04-21 14:02:52 +01:00
@classmethod
def from_row(cls, row: Row) -> "Wallets":
return cls(**dict(row))