fastapi-repository 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl
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_repository/base.py +3 -1
- {fastapi_repository-0.0.2.dist-info → fastapi_repository-0.0.4.dist-info}/METADATA +1 -1
- fastapi_repository-0.0.4.dist-info/RECORD +6 -0
- fastapi_repository-0.0.2.dist-info/RECORD +0 -6
- {fastapi_repository-0.0.2.dist-info → fastapi_repository-0.0.4.dist-info}/WHEEL +0 -0
- {fastapi_repository-0.0.2.dist-info → fastapi_repository-0.0.4.dist-info}/top_level.txt +0 -0
fastapi_repository/base.py
CHANGED
@@ -154,7 +154,8 @@ class BaseRepository:
|
|
154
154
|
conditions = []
|
155
155
|
if not disable_default_scope:
|
156
156
|
default_conditions = await self.__get_conditions(**self.default_scope)
|
157
|
-
|
157
|
+
if default_conditions:
|
158
|
+
conditions.extend(default_conditions)
|
158
159
|
|
159
160
|
conditions += await self.__get_conditions(**search_params)
|
160
161
|
query = select(func.count("*")).select_from(self.model).where(*conditions)
|
@@ -270,6 +271,7 @@ class BaseRepository:
|
|
270
271
|
f"{self.model.__name__} has no attribute '{key}'"
|
271
272
|
)
|
272
273
|
conditions.append(column == value)
|
274
|
+
return conditions
|
273
275
|
|
274
276
|
async def create(self, **create_params):
|
275
277
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastapi-repository
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.4
|
4
4
|
Summary: A base repository for FastAPI projects, inspired by Ruby on Rails' Active Record and Ransack.
|
5
5
|
Author-email: Peter Seiya Takahashi <seiya4@icloud.com>
|
6
6
|
Project-URL: Homepage, https://github.com/seiyat/fastapi-repository
|
@@ -0,0 +1,6 @@
|
|
1
|
+
fastapi_repository/__init__.py,sha256=ymIcIyfYlbv-TudpI3UOU1f2y57tEnRIFIYQMjnw0bI,87
|
2
|
+
fastapi_repository/base.py,sha256=Eo1e7Q41i0Cv4tN44SgndCZDEZmaJPL7WJO_uEPyfGs,12315
|
3
|
+
fastapi_repository-0.0.4.dist-info/METADATA,sha256=NBnxRn4iL-QJE0s1iLTyfEFVNsAH26zoTlqzF_ACpxA,1958
|
4
|
+
fastapi_repository-0.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
+
fastapi_repository-0.0.4.dist-info/top_level.txt,sha256=SSUZqBKCDo6XNjAhSFvpv4tmiPW1COl86ZR5B4ucBkU,19
|
6
|
+
fastapi_repository-0.0.4.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
fastapi_repository/__init__.py,sha256=ymIcIyfYlbv-TudpI3UOU1f2y57tEnRIFIYQMjnw0bI,87
|
2
|
-
fastapi_repository/base.py,sha256=K_rD_pu9t530od-4zJL2dmEJU_bSuuEyK11bi0UCZYM,12250
|
3
|
-
fastapi_repository-0.0.2.dist-info/METADATA,sha256=q_HdAJ9siKarj6aYZImgX6WpOjZj3kQ4PFQJq_NJOHs,1958
|
4
|
-
fastapi_repository-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
5
|
-
fastapi_repository-0.0.2.dist-info/top_level.txt,sha256=SSUZqBKCDo6XNjAhSFvpv4tmiPW1COl86ZR5B4ucBkU,19
|
6
|
-
fastapi_repository-0.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|