Spaces:
Sleeping
Sleeping
update query score card
Browse files
externals/databases/pg_crud.py
CHANGED
|
@@ -236,7 +236,9 @@ async def count_files_by_user(
|
|
| 236 |
) -> int:
|
| 237 |
"""Return number of CVFile rows belonging to a user."""
|
| 238 |
result = await db.execute(
|
| 239 |
-
select(func.count(CVFile.file_id)).where(CVFile.user_id == user_id
|
|
|
|
|
|
|
| 240 |
)
|
| 241 |
return int(result.scalar_one())
|
| 242 |
|
|
@@ -250,7 +252,8 @@ async def count_profiles_by_user(
|
|
| 250 |
result = await db.execute(
|
| 251 |
select(func.count(CVProfile.profile_id))
|
| 252 |
.join(CVFile, CVProfile.file_id == CVFile.file_id)
|
| 253 |
-
.where(CVFile.user_id == user_id
|
|
|
|
| 254 |
)
|
| 255 |
return int(result.scalar_one())
|
| 256 |
|
|
|
|
| 236 |
) -> int:
|
| 237 |
"""Return number of CVFile rows belonging to a user."""
|
| 238 |
result = await db.execute(
|
| 239 |
+
select(func.count(CVFile.file_id)).where(CVFile.user_id == user_id,
|
| 240 |
+
CVFile.is_deleted == False,
|
| 241 |
+
)
|
| 242 |
)
|
| 243 |
return int(result.scalar_one())
|
| 244 |
|
|
|
|
| 252 |
result = await db.execute(
|
| 253 |
select(func.count(CVProfile.profile_id))
|
| 254 |
.join(CVFile, CVProfile.file_id == CVFile.file_id)
|
| 255 |
+
.where(CVFile.user_id == user_id,
|
| 256 |
+
CVFile.is_deleted == False)
|
| 257 |
)
|
| 258 |
return int(result.scalar_one())
|
| 259 |
|