fastapi-mongo-base 0.8.6__tar.gz → 0.8.8__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.
Files changed (29) hide show
  1. {fastapi_mongo_base-0.8.6/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-0.8.8}/PKG-INFO +1 -1
  2. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/pyproject.toml +1 -1
  3. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/routes.py +44 -35
  4. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8/src/fastapi_mongo_base.egg-info}/PKG-INFO +1 -1
  5. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/LICENSE.txt +0 -0
  6. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/README.md +0 -0
  7. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/setup.cfg +0 -0
  8. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/__init__.py +0 -0
  9. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/cached.py +0 -0
  10. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/__init__.py +0 -0
  11. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/app_factory.py +0 -0
  12. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/config.py +0 -0
  13. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/db.py +0 -0
  14. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/enums.py +0 -0
  15. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/exceptions.py +0 -0
  16. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/core/middlewares.py +0 -0
  17. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/handlers.py +0 -0
  18. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/models.py +0 -0
  19. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/schemas.py +0 -0
  20. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/tasks.py +0 -0
  21. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/utils/__init__.py +0 -0
  22. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/utils/aionetwork.py +0 -0
  23. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/utils/basic.py +0 -0
  24. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/utils/bsontools.py +0 -0
  25. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base/utils/texttools.py +0 -0
  26. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base.egg-info/SOURCES.txt +0 -0
  27. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base.egg-info/dependency_links.txt +0 -0
  28. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base.egg-info/requires.txt +0 -0
  29. {fastapi_mongo_base-0.8.6 → fastapi_mongo_base-0.8.8}/src/fastapi_mongo_base.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi-mongo-base
3
- Version: 0.8.6
3
+ Version: 0.8.8
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.8.6"
7
+ version = "0.8.8"
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"
@@ -65,41 +65,50 @@ class AbstractBaseRouter(Generic[T, TS], metaclass=singleton.Singleton):
65
65
  self.update_request_schema = schema
66
66
 
67
67
  def config_routes(self, **kwargs):
68
- self.router.add_api_route(
69
- "/",
70
- self.list_items,
71
- methods=["GET"],
72
- response_model=self.list_response_schema,
73
- status_code=200,
74
- )
75
- self.router.add_api_route(
76
- "/{uid:uuid}",
77
- self.retrieve_item,
78
- methods=["GET"],
79
- response_model=self.retrieve_response_schema,
80
- status_code=200,
81
- )
82
- self.router.add_api_route(
83
- "/",
84
- self.create_item,
85
- methods=["POST"],
86
- response_model=self.create_response_schema,
87
- status_code=201,
88
- )
89
- self.router.add_api_route(
90
- "/{uid:uuid}",
91
- self.update_item,
92
- methods=["PATCH"],
93
- response_model=self.update_response_schema,
94
- status_code=200,
95
- )
96
- self.router.add_api_route(
97
- "/{uid:uuid}",
98
- self.delete_item,
99
- methods=["DELETE"],
100
- response_model=self.delete_response_schema,
101
- # status_code=204,
102
- )
68
+ if kwargs.get("list_route", True):
69
+ self.router.add_api_route(
70
+ "/",
71
+ self.list_items,
72
+ methods=["GET"],
73
+ response_model=self.list_response_schema,
74
+ status_code=200,
75
+ )
76
+
77
+ if kwargs.get("retrieve_route", True):
78
+ self.router.add_api_route(
79
+ "/{uid:uuid}",
80
+ self.retrieve_item,
81
+ methods=["GET"],
82
+ response_model=self.retrieve_response_schema,
83
+ status_code=200,
84
+ )
85
+
86
+ if kwargs.get("create_route", True):
87
+ self.router.add_api_route(
88
+ "/",
89
+ self.create_item,
90
+ methods=["POST"],
91
+ response_model=self.create_response_schema,
92
+ status_code=201,
93
+ )
94
+
95
+ if kwargs.get("update_route", True):
96
+ self.router.add_api_route(
97
+ "/{uid:uuid}",
98
+ self.update_item,
99
+ methods=["PATCH"],
100
+ response_model=self.update_response_schema,
101
+ status_code=200,
102
+ )
103
+
104
+ if kwargs.get("delete_route", True):
105
+ self.router.add_api_route(
106
+ "/{uid:uuid}",
107
+ self.delete_item,
108
+ methods=["DELETE"],
109
+ response_model=self.delete_response_schema,
110
+ # status_code=204,
111
+ )
103
112
 
104
113
  async def get_item(
105
114
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi-mongo-base
3
- Version: 0.8.6
3
+ Version: 0.8.8
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>