What is a lot of fucking work!
This commit is contained in:
parent
85c07ed4f3
commit
3414b5c334
8 changed files with 586 additions and 216 deletions
47
models.py
47
models.py
|
|
@ -1,6 +1,6 @@
|
|||
from typing import Any
|
||||
from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
from based.db import CONDITION_OPERATORS
|
||||
|
||||
|
||||
class AuthModel(BaseModel):
|
||||
|
|
@ -9,11 +9,12 @@ class AuthModel(BaseModel):
|
|||
|
||||
|
||||
class ItemsFieldSelectorList(BaseModel):
|
||||
fields: list[str] = []
|
||||
fields: list[str] | None = []
|
||||
|
||||
|
||||
class ColumnsDefinitionList(BaseModel):
|
||||
columns: list[str]
|
||||
class CreateUserDefinition(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
|
||||
|
||||
class UserDefinition(BaseModel):
|
||||
|
|
@ -23,28 +24,42 @@ class UserDefinition(BaseModel):
|
|||
access_token: str | None = None
|
||||
|
||||
|
||||
class ColumnDefinition(BaseModel):
|
||||
name: str
|
||||
class UserUpdateDefinition(BaseModel):
|
||||
user_id: int
|
||||
password: str
|
||||
access_token: str
|
||||
|
||||
|
||||
class ColumnConditionCompat(BaseModel):
|
||||
column: str
|
||||
operator: CONDITION_OPERATORS
|
||||
value: Any
|
||||
isString: bool = False
|
||||
isLike: bool = True
|
||||
|
||||
|
||||
class ItemDeletionDefinitionList(BaseModel):
|
||||
defs: list[ColumnDefinition]
|
||||
|
||||
|
||||
class TableDefinition(BaseModel):
|
||||
table_id: UUID
|
||||
table_id: str
|
||||
table_name: str
|
||||
columns: str
|
||||
system: bool
|
||||
hidden: bool
|
||||
|
||||
|
||||
class TableListDefinition(BaseModel):
|
||||
tables: list[TableDefinition]
|
||||
class OkResponse(BaseModel):
|
||||
ok: bool = True
|
||||
|
||||
|
||||
class ErrorResponseDefinition(BaseModel):
|
||||
class ErrorResponse(BaseModel):
|
||||
error: str
|
||||
|
||||
|
||||
class AccessTokenResponse(BaseModel):
|
||||
access_token: str
|
||||
|
||||
|
||||
class TableItemsResponse(BaseModel):
|
||||
items: list[dict[str, Any]]
|
||||
|
||||
|
||||
class CreateAssetResponse(BaseModel):
|
||||
ok: bool = True
|
||||
fid: str
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue