Skip to content

Commit

Permalink
isort fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sovraska committed Dec 21, 2023
1 parent 347bb18 commit 0b7011d
Show file tree
Hide file tree
Showing 24 changed files with 68 additions and 75 deletions.
10 changes: 5 additions & 5 deletions app/api/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .user import router as user_router # noqa
from .achievement import router as achievement_router # noqa
from .course import router as course_router # noqa
from .examination import router as examination_router # noqa
from .group import router as group_router # noqa
from .notification import router as notification_router # noqa
from .profile import router as profile_router # noqa
from .tariff import router as tariff_router # noqa
from .notification import router as notification_router # noqa
from .examination import router as examination_router # noqa
from .achievement import router as achievement_router # noqa
from .course import router as course_router # noqa
from .task import router as task_router # noqa
from .user import router as user_router # noqa
2 changes: 1 addition & 1 deletion app/api/endpoints/achievement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from sqlalchemy.ext.asyncio import AsyncSession

from app.api.validators import check_name_duplicate
from app.schemas.achievement import AchievementRead, AchievementCreate
from app.core.db import get_async_session
from app.crud import achievement_crud
from app.schemas.achievement import AchievementCreate, AchievementRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
2 changes: 1 addition & 1 deletion app/api/endpoints/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from sqlalchemy.ext.asyncio import AsyncSession

from app.api.validators import check_name_duplicate
from app.schemas.course import CourseCreate, CourseRead
from app.core.db import get_async_session
from app.crud import course_crud
from app.schemas.course import CourseCreate, CourseRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
2 changes: 1 addition & 1 deletion app/api/endpoints/examination.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from sqlalchemy.ext.asyncio import AsyncSession

from app.api.validators import check_name_duplicate
from app.schemas.examination import ExaminationRead, ExaminationCreate
from app.core.db import get_async_session
from app.crud import examination_crud
from app.schemas.examination import ExaminationCreate, ExaminationRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
4 changes: 2 additions & 2 deletions app/api/endpoints/group.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession

from app.schemas.group import GroupRead, GroupCreate
from app.api.validators import check_name_duplicate
from app.core.db import get_async_session
from app.crud import group_crud
from app.api.validators import check_name_duplicate
from app.schemas.group import GroupCreate, GroupRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
1 change: 0 additions & 1 deletion app/api/endpoints/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from app.crud import notification_crud
from app.schemas.notification import NotificationCreate, NotificationRead


router = APIRouter()


Expand Down
6 changes: 3 additions & 3 deletions app/api/endpoints/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from sqlalchemy.ext.asyncio import AsyncSession

from app.api.validators import check_obj_exists
from app.models import User
from app.schemas.profile import ProfileRead, ProfileCreate
from app.core.db import get_async_session
from app.crud import profile_crud, user_crud
from app.core.user import current_user
from app.crud import profile_crud, user_crud
from app.models import User
from app.schemas.profile import ProfileCreate, ProfileRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
8 changes: 4 additions & 4 deletions app/api/endpoints/tariff.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession

from app.api.validators import check_name_duplicate, check_obj_exists
from app.core.db import get_async_session
from app.core.user import current_user
from app.crud import tariff_crud, user_crud
from app.models import User
from app.schemas.tariff import TariffRead, TariffCreate
from app.schemas.tariff import TariffCreate, TariffRead
from app.schemas.user import UserRead
from app.core.db import get_async_session
from app.crud import tariff_crud, user_crud
from app.api.validators import check_name_duplicate, check_obj_exists
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
4 changes: 2 additions & 2 deletions app/api/endpoints/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession

from app.schemas.task import TaskRead, TaskCreate
from app.api.validators import check_name_duplicate
from app.core.db import get_async_session
from app.crud import task_crud
from app.api.validators import check_name_duplicate
from app.schemas.task import TaskCreate, TaskRead
from app.services.endpoints_services import delete_obj

router = APIRouter()
Expand Down
9 changes: 4 additions & 5 deletions app/api/routers.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from fastapi import APIRouter

from app.api.endpoints import (
user_router, group_router, tariff_router,
examination_router, course_router, task_router,
achievement_router, profile_router,
)
from app.api.endpoints import (achievement_router, course_router,
examination_router, group_router,
profile_router, tariff_router, task_router,
user_router)

main_router = APIRouter()

Expand Down
4 changes: 1 addition & 3 deletions app/core/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from app.core.db import Base # noqa
from app.models import ( # noqa
Group, User, Profile, Tariff
)
from app.models import Group, Profile, Tariff, User # noqa
1 change: 1 addition & 0 deletions app/core/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Optional

from pydantic_settings import BaseSettings


Expand Down
15 changes: 4 additions & 11 deletions app/core/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@
from typing import Optional, Union

from fastapi import Depends, Request
from fastapi_users import (
BaseUserManager,
FastAPIUsers,
IntegerIDMixin,
InvalidPasswordException,
)
from fastapi_users.authentication import (
AuthenticationBackend,
BearerTransport,
JWTStrategy,
)
from fastapi_users import (BaseUserManager, FastAPIUsers, IntegerIDMixin,
InvalidPasswordException)
from fastapi_users.authentication import (AuthenticationBackend,
BearerTransport, JWTStrategy)
from fastapi_users_db_sqlalchemy import SQLAlchemyUserDatabase
from sqlalchemy.ext.asyncio import AsyncSession

Expand Down
10 changes: 5 additions & 5 deletions app/crud/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .achievement import achievement_crud # noqa
from .course import course_crud # noqa
from .examination import examination_crud # noqa
from .group import group_crud # noqa
from .user import user_crud # noqa
from .notification import notification_crud # noqa
from .profile import profile_crud # noqa
from .tariff import tariff_crud # noqa
from .notification import notification_crud # noqa
from .examination import examination_crud # noqa
from .achievement import achievement_crud # noqa
from .course import course_crud # noqa
from .task import task_crud # noqa
from .user import user_crud # noqa
10 changes: 5 additions & 5 deletions app/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .user import User # noqa
from .achievement import Achievement # noqa
from .course import Course # noqa
from .examination import Examination # noqa
from .group import Group # noqa
from .notification import Notification # noqa
from .profile import Profile # noqa
from .tariff import Tariff # noqa
from .notification import Notification # noqa
from .examination import Examination # noqa
from .achievement import Achievement # noqa
from .course import Course # noqa
from .task import Task # noqa
from .user import User # noqa
4 changes: 2 additions & 2 deletions app/models/achievement.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from typing import TYPE_CHECKING

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

if TYPE_CHECKING:
from app.models import Profile
Expand Down
6 changes: 3 additions & 3 deletions app/models/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

from typing import TYPE_CHECKING

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

from .task import task_course_association

if TYPE_CHECKING:
from .user import User
from .tariff import Tariff
from .task import Task
from .user import User


course_user_association = Table(
Expand Down
4 changes: 2 additions & 2 deletions app/models/examination.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from typing import TYPE_CHECKING

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

if TYPE_CHECKING:
from app.models import User
Expand Down
6 changes: 3 additions & 3 deletions app/models/group.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import annotations

from typing import List, TYPE_CHECKING
from typing import TYPE_CHECKING, List

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

if TYPE_CHECKING:
from app.models import User
Expand Down
4 changes: 2 additions & 2 deletions app/models/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from typing import TYPE_CHECKING

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

if TYPE_CHECKING:
from app.models import User
Expand Down
7 changes: 4 additions & 3 deletions app/models/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

from typing import TYPE_CHECKING

from sqlalchemy import Column, String, SmallInteger, ForeignKey
from sqlalchemy import Column, ForeignKey, SmallInteger, String
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

from .achievement import achievement_profile_association

if TYPE_CHECKING:
from .user import User
from .achievement import Achievement
from .user import User


class Profile(Base):
Expand Down
5 changes: 3 additions & 2 deletions app/models/tariff.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
from sqlalchemy import Column, String, Text
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

from .course import course_tariff_association

if TYPE_CHECKING:
from .user import User
from .course import Course
from .user import User


class Tariff(Base):
Expand Down
4 changes: 2 additions & 2 deletions app/models/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from typing import TYPE_CHECKING

from sqlalchemy import (Column, String, Text, Table, ForeignKey, Integer,
from sqlalchemy import (Column, ForeignKey, Integer, String, Table, Text,
UniqueConstraint)
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base
from app.core.config import settings
from app.core.db import Base

if TYPE_CHECKING:
from .user import Course
Expand Down
15 changes: 8 additions & 7 deletions app/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
from typing import TYPE_CHECKING

from fastapi_users_db_sqlalchemy import SQLAlchemyBaseUserTable
from sqlalchemy import Enum, Column, String, ForeignKey
from sqlalchemy import Column, Enum, ForeignKey, String
from sqlalchemy.orm import Mapped, relationship

from app.core.db import Base

from .course import course_user_association
from .examination import examination_user_association
from .group import group_user_association
from .notification import notification_user_association
from .examination import examination_user_association
from .course import course_user_association

if TYPE_CHECKING:
from .tariff import Tariff
from .profile import Profile
from .course import Course
from .examination import Examination
from .group import Group
from .notification import Notification
from .examination import Examination
from .course import Course
from .profile import Profile
from .tariff import Tariff


class UserRoleEnum(enum.Enum):
Expand Down

0 comments on commit 0b7011d

Please sign in to comment.