upgrading libraries
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
from typing import List, Literal
|
||||
from typing import List, Literal, Optional
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel, Field, validator
|
||||
@@ -52,10 +52,10 @@ class DraftParty(BaseModel):
|
||||
class Party(BaseModel):
|
||||
entity: Entity
|
||||
part: str
|
||||
representative: Entity = None
|
||||
representative: Optional[Entity] = None
|
||||
signature_uuid: str
|
||||
signature_affixed: bool = False
|
||||
signature_png: str = None
|
||||
signature_png: Optional[str] = None
|
||||
|
||||
|
||||
class ProvisionGenuine(BaseModel):
|
||||
@@ -181,7 +181,7 @@ class Contract(CrudDocument):
|
||||
lawyer: Entity = Field(title="Avocat en charge")
|
||||
location: str = Field(title="Lieu")
|
||||
date: datetime.date = Field(title="Date")
|
||||
label: str = None
|
||||
label: Optional[str] = None
|
||||
|
||||
@validator("label", always=True)
|
||||
def generate_label(cls, v, values, **kwargs):
|
||||
|
||||
@@ -23,8 +23,8 @@ class Individual(EntityType):
|
||||
props={"items-per-row": "4", "numbered": True},
|
||||
title="Surnoms"
|
||||
)
|
||||
day_of_birth: date = Field(default=None, title='Date de naissance')
|
||||
place_of_birth: str = Field(default="", title='Lieu de naissance')
|
||||
day_of_birth: Optional[date] = Field(default=None, title='Date de naissance')
|
||||
place_of_birth: Optional[str] = Field(default="", title='Lieu de naissance')
|
||||
|
||||
@property
|
||||
def label(self) -> str:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Optional, TypeVar
|
||||
from datetime import datetime
|
||||
from pydantic import Field
|
||||
from beanie import PydanticObjectId
|
||||
from beanie import Document
|
||||
|
||||
from fastapi_users.db import BeanieBaseUser, BeanieUserDatabase
|
||||
from fastapi_users_db_beanie.access_token import BeanieAccessTokenDatabase, BeanieBaseAccessToken
|
||||
@@ -9,11 +9,11 @@ from fastapi_users_db_beanie.access_token import BeanieAccessTokenDatabase, Bean
|
||||
from pymongo import IndexModel
|
||||
|
||||
|
||||
class AccessToken(BeanieBaseAccessToken[PydanticObjectId]):
|
||||
class AccessToken(BeanieBaseAccessToken, Document):
|
||||
pass
|
||||
|
||||
|
||||
class User(BeanieBaseUser[PydanticObjectId]):
|
||||
class User(BeanieBaseUser, Document):
|
||||
login: str
|
||||
entity_id: str
|
||||
created_at: datetime = Field(default=datetime.utcnow(), nullable=False)
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Annotated
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from fastapi_users import schemas
|
||||
|
||||
from .models import User
|
||||
@@ -9,12 +11,8 @@ class UserBase(schemas.CreateUpdateDictModel):
|
||||
|
||||
|
||||
class UserRead(User):
|
||||
class Config:
|
||||
fields = {
|
||||
'_id': {'alias': 'id'},
|
||||
'hashed_password': {'exclude': True}
|
||||
}
|
||||
|
||||
_id: Annotated[str, Field(alias='id')]
|
||||
hashed_password: Annotated[str, Field(exclude=True)]
|
||||
|
||||
class UserCreate(UserBase):
|
||||
login: str
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
fastapi==0.88.0
|
||||
fastapi_users==10.2.1
|
||||
fastapi_users_db_beanie==1.1.2
|
||||
motor==3.1.1
|
||||
fastapi-paginate==0.1.0
|
||||
fastapi
|
||||
fastapi_users
|
||||
fastapi_users_db_beanie
|
||||
motor
|
||||
fastapi-paginate
|
||||
uvicorn
|
||||
jinja2
|
||||
weasyprint
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
back:
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user