Skip to content

Commit

Permalink
fixed back
Browse files Browse the repository at this point in the history
  • Loading branch information
xaer981 committed Dec 12, 2023
1 parent 799c7df commit 8281d5c
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 77 deletions.
5 changes: 3 additions & 2 deletions app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic import BaseSettings


class Settings(BaseSettings):
Expand All @@ -21,7 +21,8 @@ class Settings(BaseSettings):
universe_domain: Optional[str] = None
email: Optional[str] = None

model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8')
class Config:
env_file = '.env'


settings = Settings()
8 changes: 5 additions & 3 deletions app/schemas/charity_project.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Optional

from pydantic import BaseModel, ConfigDict, Field, PositiveInt
from pydantic import BaseModel, Extra, Field, PositiveInt

from app.constants import (DESCRIPTION_MIN_LENGTH, NAME_MAX_LENGTH,
NAME_MIN_LENGTH)
Expand All @@ -21,7 +21,8 @@ class CharityProjectDB(CharityProjectCreate):
create_date: datetime
close_date: Optional[datetime]

model_config = ConfigDict(from_attributes=True)
class Config:
orm_mode = True


class CharityProjectUpdate(CharityProjectCreate):
Expand All @@ -32,4 +33,5 @@ class CharityProjectUpdate(CharityProjectCreate):
min_length=1)
full_amount: Optional[PositiveInt]

model_config = ConfigDict(extra='forbid')
class Config:
extra = Extra.forbid
5 changes: 3 additions & 2 deletions app/schemas/donation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Optional

from pydantic import BaseModel, PositiveInt, ConfigDict
from pydantic import BaseModel, PositiveInt


class DonationCreate(BaseModel):
Expand All @@ -13,7 +13,8 @@ class DonationRead(DonationCreate):
id: int
create_date: datetime

model_config = ConfigDict(from_attributes=True)
class Config:
orm_mode = True


class DonationDB(DonationRead):
Expand Down
141 changes: 71 additions & 70 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,80 +1,81 @@
aiofiles==23.2.1
aiogoogle==5.6.0
aiohttp==3.9.1
aiosignal==1.3.1
aiosqlite==0.19.0
alembic==1.13.0
annotated-types==0.6.0
anyio==3.7.1
asgiref==3.7.2
async-timeout==4.0.3
atomicwrites==1.4.1
attrs==23.1.0
bcrypt==4.0.1
cachetools==5.3.2
certifi==2023.11.17
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
cryptography==41.0.7
dnspython==2.4.2
email-validator==2.0.0.post2
Faker==12.0.1
fastapi==0.104.1
fastapi-users==12.1.2
fastapi-users-db-sqlalchemy==6.0.1
flake8==6.1.0
freezegun==1.3.1
frozenlist==1.4.0
google-auth==2.25.2
greenlet==3.0.2
h11==0.14.0
httpcore==1.0.2
httptools==0.6.1
httpx==0.25.2
idna==3.6
iniconfig==2.0.0
#
# These requirements were autogenerated by pipenv
# To regenerate from the project's Pipfile, run:
#
# pipenv lock --requirements
#

-i https://pypi.org/simple
aiofiles==0.8.0; python_version >= '3.6' and python_version < '4'
aiogoogle==4.2.0
aiohttp==3.8.1; python_version >= '3.6'
aiosignal==1.2.0; python_version >= '3.6'
aiosqlite==0.17.0
alembic==1.7.7
anyio==3.6.1
asgiref==3.5.2
async-timeout==4.0.2; python_version >= '3.6'
attrs==21.4.0
bcrypt==3.2.2
cachetools==5.2.0; python_version ~= '3.7'
certifi==2022.5.18.1
cffi==1.15.0
charset-normalizer==2.0.12
click==8.1.3
cryptography==37.0.2
dnspython==2.2.1
email-validator==1.2.1
faker==12.0.1
fastapi-users-db-sqlalchemy==4.0.3
fastapi-users[sqlalchemy]==10.0.4
fastapi==0.78.0
flake8==4.0.1
freezegun==1.2.1
frozenlist==1.3.0; python_version >= '3.7'
google-auth==2.8.0
greenlet==1.1.2
h11==0.13.0
httptools==0.4.0
idna==3.3
iniconfig==1.1.1
lock==2018.3.25.2110
makefun==1.15.2
Mako==1.3.0
MarkupSafe==2.1.3
mccabe==0.7.0
makefun==1.13.1
mako==1.2.0
markupsafe==2.1.1
mccabe==0.6.1
mixer==7.2.2
multidict==6.0.4
packaging==23.2
passlib==1.7.4
pluggy==1.3.0
multidict==6.0.2; python_version >= '3.7'
packaging==21.3; python_version >= '3.6'
passlib[bcrypt]==1.7.4
pluggy==1.0.0
py==1.11.0
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycodestyle==2.11.1
pyasn1-modules==0.2.8
pyasn1==0.4.8
pycodestyle==2.8.0
pycparser==2.21
pydantic==2.5.2
pydantic-settings==2.1.0
pydantic_core==2.14.5
pyflakes==3.1.0
PyJWT==2.8.0
pyparsing==3.1.1
pytest==7.4.3
pytest-asyncio==0.23.2
pydantic==1.9.1
pyflakes==2.4.0
pyjwt[crypto]==2.3.0
pyparsing==3.0.9
pytest-asyncio==0.18.3
pytest-freezegun==0.4.2
pytest-pythonpath==0.7.3
pytest-pythonpath==0.7.4
pytest==6.2.5
python-dateutil==2.8.2
python-dotenv==1.0.0
python-multipart==0.0.6
PyYAML==6.0.1
requests==2.31.0
rsa==4.9
python-dotenv==0.20.0
python-multipart==0.0.5
pyyaml==6.0
requests==2.27.1
rsa==4.8; python_version >= '3.6'
six==1.16.0
sniffio==1.3.0
SQLAlchemy==2.0.23
starlette==0.27.0
sniffio==1.2.0
sqlalchemy==1.4.36
starlette==0.19.1
toml==0.10.2
tonyg-rfc3339==0.1
typing_extensions==4.9.0
urllib3==2.1.0
uvicorn==0.24.0.post1
typing-extensions==4.2.0
urllib3==1.26.9
uvicorn[standard]==0.17.6
watchgod==0.8.2
websockets==12.0
yarl==1.9.4
websockets==10.3
yarl==1.7.2; python_version >= '3.6'

0 comments on commit 8281d5c

Please sign in to comment.