Switching lnurl links from model to crud

This commit is contained in:
arcbtc 2023-12-30 21:37:52 +00:00
parent c749da80dd
commit ba7e11e30d
14 changed files with 100 additions and 180 deletions

View file

@ -1,8 +1,13 @@
# Models for retrieving data from the database
# Includes some classmethods where we can add some logic to the data
from sqlite3 import Row
from typing import Optional, List
from pydantic import BaseModel
from fastapi import Request
from lnbits.lnurl import encode as lnurl_encode
from urllib.parse import urlparse
class CreateTempData(BaseModel):
wallet: Optional[str]
@ -18,6 +23,8 @@ class Temp(BaseModel):
total: Optional[int]
lnurlpayamount: Optional[int]
lnurlwithdrawamount: Optional[int]
lnurlpay: str
lnurlwithdraw: str
@classmethod
def from_row(cls, row: Row) -> "Temp":