From 88e8454c5469757580983778957e9f58fd8f174c Mon Sep 17 00:00:00 2001 From: Roman Reznikov Date: Sun, 3 Jul 2022 16:58:14 +0400 Subject: [PATCH] #22: refactor: rename base repository (`BaseRepository` -> `BaseRedisRepository`) --- src/ugc/domain/bookmarks/repositories.py | 4 ++-- src/ugc/domain/progress/repositories.py | 4 ++-- src/ugc/infrastructure/db/repositories.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ugc/domain/bookmarks/repositories.py b/src/ugc/domain/bookmarks/repositories.py index 8102890..ffde75f 100644 --- a/src/ugc/domain/bookmarks/repositories.py +++ b/src/ugc/domain/bookmarks/repositories.py @@ -5,14 +5,14 @@ from aredis_om import NotFoundError as RedisNotFoundError from ugc.common.exceptions import NotFoundError -from ugc.infrastructure.db.repositories import BaseRepository +from ugc.infrastructure.db.repositories import BaseRedisRepository from . import types from .factories import FilmBookmarkFactory from .models import FilmBookmark -class BookmarkRepository(BaseRepository[FilmBookmark]): +class BookmarkRepository(BaseRedisRepository[FilmBookmark]): """Репозиторий для работы с данными закладок.""" model = FilmBookmark diff --git a/src/ugc/domain/progress/repositories.py b/src/ugc/domain/progress/repositories.py index 7548fc7..8b79a97 100644 --- a/src/ugc/domain/progress/repositories.py +++ b/src/ugc/domain/progress/repositories.py @@ -1,14 +1,14 @@ from aredis_om import NotFoundError as RedisNotFoundError from ugc.common.exceptions import NotFoundError -from ugc.infrastructure.db.repositories import BaseRepository +from ugc.infrastructure.db.repositories import BaseRedisRepository from .factories import FilmProgressFactory from .models import UserFilmProgress from .types import FilmProgress -class FilmProgressRepository(BaseRepository[UserFilmProgress]): +class FilmProgressRepository(BaseRedisRepository[UserFilmProgress]): """Репозиторий для работы с данными прогресса фильма.""" model = UserFilmProgress diff --git a/src/ugc/infrastructure/db/repositories.py b/src/ugc/infrastructure/db/repositories.py index 31316b0..617240f 100644 --- a/src/ugc/infrastructure/db/repositories.py +++ b/src/ugc/infrastructure/db/repositories.py @@ -14,7 +14,7 @@ class ModelInfo(NamedTuple): created: bool -class BaseRepository(Generic[_RM]): +class BaseRedisRepository(Generic[_RM]): """Базовый репозиторий для работы с данными модели `RedisModel`.""" model: Type[_RM]