Update code via agent code generation

This commit is contained in:
Automated Action 2025-06-06 10:44:35 +00:00
parent 73c662b24c
commit c0a6d33d43
6 changed files with 9 additions and 14 deletions

View File

@ -1,6 +1,4 @@
import os
from pathlib import Path
from typing import List, Optional
from pydantic_settings import BaseSettings

View File

@ -1,7 +1,7 @@
from datetime import datetime
from typing import List, Optional, Union, Dict, Any
from typing import List, Optional
from sqlalchemy import and_, desc, asc
from sqlalchemy import desc, asc
from sqlalchemy.orm import Session
from app.models.task import Task, TaskStatus
@ -12,7 +12,7 @@ def get_task(db: Session, task_id: int) -> Optional[Task]:
"""
Get a task by ID.
"""
return db.query(Task).filter(Task.id == task_id, Task.is_deleted == False).first()
return db.query(Task).filter(Task.id == task_id, not Task.is_deleted).first()
def get_tasks(
@ -27,7 +27,7 @@ def get_tasks(
"""
Get a list of tasks with filtering, sorting and pagination.
"""
query = db.query(Task).filter(Task.is_deleted == False)
query = db.query(Task).filter(not Task.is_deleted)
# Apply status filter if provided
if status:
@ -59,7 +59,7 @@ def get_tasks_count(
"""
Get the total count of tasks with the specified filters.
"""
query = db.query(Task).filter(Task.is_deleted == False)
query = db.query(Task).filter(not Task.is_deleted)
# Apply status filter if provided
if status:

View File

@ -1,9 +1,7 @@
from datetime import datetime
from typing import Optional
from enum import Enum as PyEnum
from sqlalchemy import Boolean, Column, DateTime, Enum, Integer, String, Text, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy import Boolean, Column, DateTime, Enum, Integer, String, Text
from app.db.base_class import Base

View File

@ -1,4 +1,4 @@
from typing import Any, Dict, List, Optional
from typing import List
from pydantic import BaseModel, Field

View File

@ -1,4 +1,4 @@
from typing import Generic, List, Optional, TypeVar
from typing import Generic, List, TypeVar
from pydantic import BaseModel, Field

View File

@ -1,10 +1,10 @@
import os
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
from app.db.base import Base
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
@ -16,7 +16,6 @@ fileConfig(config.config_file_name)
# add your model's MetaData object here
# for 'autogenerate' support
from app.db.base import Base
target_metadata = Base.metadata
# other values from the config, defined by the needs of env.py,