Spaces:
Runtime error
Runtime error
Download check_tasks.py from Quratulain1/Deploy-Backend: direct link, hf CLI and curl.
- Browser
- Download file 731 Bytes
-
https://huggingface.co/spaces/Quratulain1/Deploy-Backend/resolve/main/check_tasks.py
- Command line
-
hf download hf://spaces/Quratulain1/Deploy-Backend/check_tasks.py
-
curl -L -o check_tasks.py https://huggingface.co/spaces/Quratulain1/Deploy-Backend/resolve/main/check_tasks.py
731 Bytes
| import asyncio | |
| from core.db import async_session_maker | |
| from sqlmodel import select | |
| from models.task import Task | |
| async def check_tasks(): | |
| async with async_session_maker() as session: | |
| result = await session.execute(select(Task)) | |
| tasks = result.scalars().all() | |
| print(f'\n=== Total tasks in database: {len(tasks)} ===\n') | |
| for t in tasks: | |
| print(f'Task {t.id}: {t.title}') | |
| print(f' User: {t.user_id}') | |
| print(f' Priority: {t.priority}') | |
| print(f' Completed: {t.is_completed}') | |
| print(f' Due Date: {t.due_date}') | |
| print(f' Created: {t.created_at}') | |
| print() | |
| if __name__ == "__main__": | |
| asyncio.run(check_tasks()) | |