Adjust pydantic code to v2.

pull/184/head
Tom Hacohen 4 months ago
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…
Cancel
Save