fastapi-mongo-base 0.9.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_mongo_base-0.9.0/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-0.9.2}/PKG-INFO +1 -1
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/pyproject.toml +1 -1
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/routes.py +21 -7
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2/src/fastapi_mongo_base.egg-info}/PKG-INFO +1 -1
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/LICENSE.txt +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/README.md +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/setup.cfg +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/__init__.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/cached.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/__init__.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/app_factory.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/config.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/db.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/enums.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/exceptions.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/middlewares.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/handlers.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/models.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/schemas.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/tasks.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/__init__.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/aionetwork.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/basic.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/bsontools.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/imagetools.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/texttools.py +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/SOURCES.txt +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/dependency_links.txt +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/requires.txt +0 -0
- {fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/top_level.txt +0 -0
{fastapi_mongo_base-0.9.0/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-0.9.2}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fastapi-mongo-base"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.2"
|
|
8
8
|
description = "A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -144,13 +144,12 @@ class AbstractBaseRouter(Generic[T, TS], metaclass=singleton.Singleton):
|
|
|
144
144
|
user_id = user.uid if user else None
|
|
145
145
|
return user_id
|
|
146
146
|
|
|
147
|
-
async def
|
|
147
|
+
async def _list_items(
|
|
148
148
|
self,
|
|
149
149
|
request: Request,
|
|
150
|
-
offset: int =
|
|
151
|
-
limit: int =
|
|
152
|
-
|
|
153
|
-
created_at_to: datetime | None = None,
|
|
150
|
+
offset: int = 0,
|
|
151
|
+
limit: int = 10,
|
|
152
|
+
**kwargs,
|
|
154
153
|
):
|
|
155
154
|
user_id = await self.get_user_id(request)
|
|
156
155
|
limit = max(1, min(limit, Settings.page_max_limit))
|
|
@@ -159,8 +158,7 @@ class AbstractBaseRouter(Generic[T, TS], metaclass=singleton.Singleton):
|
|
|
159
158
|
user_id=user_id,
|
|
160
159
|
offset=offset,
|
|
161
160
|
limit=limit,
|
|
162
|
-
|
|
163
|
-
created_at_to=created_at_to,
|
|
161
|
+
**kwargs,
|
|
164
162
|
)
|
|
165
163
|
items_in_schema = [self.list_item_schema(**item.model_dump()) for item in items]
|
|
166
164
|
|
|
@@ -171,6 +169,22 @@ class AbstractBaseRouter(Generic[T, TS], metaclass=singleton.Singleton):
|
|
|
171
169
|
limit=limit,
|
|
172
170
|
)
|
|
173
171
|
|
|
172
|
+
async def list_items(
|
|
173
|
+
self,
|
|
174
|
+
request: Request,
|
|
175
|
+
offset: int = Query(0, ge=0),
|
|
176
|
+
limit: int = Query(10, ge=1, le=Settings.page_max_limit),
|
|
177
|
+
created_at_from: datetime | None = None,
|
|
178
|
+
created_at_to: datetime | None = None,
|
|
179
|
+
):
|
|
180
|
+
return await self._list_items(
|
|
181
|
+
request=request,
|
|
182
|
+
offset=offset,
|
|
183
|
+
limit=limit,
|
|
184
|
+
created_at_from=created_at_from,
|
|
185
|
+
created_at_to=created_at_to,
|
|
186
|
+
)
|
|
187
|
+
|
|
174
188
|
async def retrieve_item(
|
|
175
189
|
self,
|
|
176
190
|
request: Request,
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2/src/fastapi_mongo_base.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/__init__.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/app_factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/exceptions.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/core/middlewares.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/__init__.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/aionetwork.py
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/bsontools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/imagetools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base/utils/texttools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/requires.txt
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.0 → fastapi_mongo_base-0.9.2}/src/fastapi_mongo_base.egg-info/top_level.txt
RENAMED
|
File without changes
|