This commit is contained in:
dni ⚡
2024-10-17 10:36:32 +02:00
parent 42c2e5b267
commit 2764fefb3d
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)