This commit is contained in:
dni ⚡
2024-10-10 09:07:36 +02:00
parent d813544bf4
commit 06bdd61c8e
3 changed files with 52 additions and 13 deletions
+15
View File
@@ -2,6 +2,8 @@ import random
import string
from typing import Optional
from pydantic import BaseModel
from lnbits.db import FromRowModel
from lnbits.wallets import get_funding_source, set_funding_source
@@ -16,6 +18,19 @@ class DbTestModel(FromRowModel):
value: Optional[str] = None
class DbTestModelInner(BaseModel):
id: int
label: str
description: Optional[str] = None
class DbTestModel2(BaseModel):
id: int
name: str
value: Optional[str] = None
child: DbTestModelInner
def get_random_string(iterations: int = 10):
return "".join(
random.SystemRandom().choice(string.ascii_uppercase + string.digits)