1
0
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:
Tom Hacohen 2024-06-08 18:10:34 -04:00
parent 0cdab19308
commit fb9cc701d0
5 changed files with 8 additions and 8 deletions

View File

@ -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):

View File

@ -76,7 +76,7 @@ class LoginOut(BaseModel):
class Authentication(BaseModel):
class Config:
keep_untouched = (cached_property,)
ignored_types= (cached_property,)
response: bytes
signature: bytes

View File

@ -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(

View File

@ -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":

View File

@ -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":