mirror of
https://github.com/etesync/server
synced 2024-12-26 17:28:08 +00:00
Adjust pydantic code to v2.
This commit is contained in:
parent
0cdab19308
commit
fb9cc701d0
@ -11,7 +11,7 @@ class HttpErrorField(BaseModel):
|
||||
detail: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class HttpErrorOut(BaseModel):
|
||||
@ -20,7 +20,7 @@ class HttpErrorOut(BaseModel):
|
||||
errors: t.Optional[t.List[HttpErrorField]]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class CustomHttpException(HTTPException):
|
||||
|
@ -76,7 +76,7 @@ class LoginOut(BaseModel):
|
||||
|
||||
class Authentication(BaseModel):
|
||||
class Config:
|
||||
keep_untouched = (cached_property,)
|
||||
ignored_types= (cached_property,)
|
||||
|
||||
response: bytes
|
||||
signature: bytes
|
||||
|
@ -52,7 +52,7 @@ class CollectionItemRevisionInOut(BaseModel):
|
||||
chunks: t.List[ChunkType]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
@classmethod
|
||||
def from_orm_context(
|
||||
@ -78,7 +78,7 @@ class CollectionItemCommon(BaseModel):
|
||||
|
||||
class CollectionItemOut(CollectionItemCommon):
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
@classmethod
|
||||
def from_orm_context(
|
||||
|
@ -34,7 +34,7 @@ class UserInfoOut(BaseModel):
|
||||
pubkey: bytes
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes= True
|
||||
|
||||
@classmethod
|
||||
def from_orm(cls: t.Type["UserInfoOut"], obj: models.UserInfo) -> "UserInfoOut":
|
||||
@ -67,7 +67,7 @@ class CollectionInvitationOut(CollectionInvitationCommon):
|
||||
fromPubkey: bytes
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
@classmethod
|
||||
def from_orm(cls: t.Type["CollectionInvitationOut"], obj: models.CollectionInvitation) -> "CollectionInvitationOut":
|
||||
|
@ -39,7 +39,7 @@ class CollectionMemberOut(BaseModel):
|
||||
accessLevel: models.AccessLevels
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
from_attributes = True
|
||||
|
||||
@classmethod
|
||||
def from_orm(cls: t.Type["CollectionMemberOut"], obj: models.CollectionMember) -> "CollectionMemberOut":
|
||||
|
Loading…
Reference in New Issue
Block a user