Add files via upload

This commit is contained in:
Arc 2023-02-14 14:46:19 +00:00 committed by GitHub
commit ed083e4268
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 833 additions and 0 deletions

28
models.py Normal file
View file

@ -0,0 +1,28 @@
from sqlite3 import Row
from typing import List, Optional
from fastapi import Query
from pydantic import BaseModel
class Target(BaseModel):
wallet: str
source: str
percent: float
tag: str
alias: Optional[str]
@classmethod
def from_row(cls, row: Row):
return cls(**dict(row))
class TargetPutList(BaseModel):
wallet: str = Query(...)
alias: str = Query("")
percent: float = Query(..., ge=0, lt=100)
tag: str
class TargetPut(BaseModel):
__root__: List[TargetPutList]