Update code via agent code generation
This commit is contained in:
parent
73c662b24c
commit
c0a6d33d43
@ -1,6 +1,4 @@
|
|||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Optional
|
|
||||||
|
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from datetime import datetime
|
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 sqlalchemy.orm import Session
|
||||||
|
|
||||||
from app.models.task import Task, TaskStatus
|
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.
|
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(
|
def get_tasks(
|
||||||
@ -27,7 +27,7 @@ def get_tasks(
|
|||||||
"""
|
"""
|
||||||
Get a list of tasks with filtering, sorting and pagination.
|
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
|
# Apply status filter if provided
|
||||||
if status:
|
if status:
|
||||||
@ -59,7 +59,7 @@ def get_tasks_count(
|
|||||||
"""
|
"""
|
||||||
Get the total count of tasks with the specified filters.
|
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
|
# Apply status filter if provided
|
||||||
if status:
|
if status:
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional
|
|
||||||
from enum import Enum as PyEnum
|
from enum import Enum as PyEnum
|
||||||
|
|
||||||
from sqlalchemy import Boolean, Column, DateTime, Enum, Integer, String, Text, ForeignKey
|
from sqlalchemy import Boolean, Column, DateTime, Enum, Integer, String, Text
|
||||||
from sqlalchemy.orm import relationship
|
|
||||||
|
|
||||||
from app.db.base_class import Base
|
from app.db.base_class import Base
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Dict, List, Optional
|
from typing import List
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import Generic, List, Optional, TypeVar
|
from typing import Generic, List, TypeVar
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import os
|
|
||||||
from logging.config import fileConfig
|
from logging.config import fileConfig
|
||||||
|
|
||||||
from sqlalchemy import engine_from_config
|
from sqlalchemy import engine_from_config
|
||||||
from sqlalchemy import pool
|
from sqlalchemy import pool
|
||||||
|
|
||||||
from alembic import context
|
from alembic import context
|
||||||
|
from app.db.base import Base
|
||||||
|
|
||||||
# this is the Alembic Config object, which provides
|
# this is the Alembic Config object, which provides
|
||||||
# access to the values within the .ini file in use.
|
# 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
|
# add your model's MetaData object here
|
||||||
# for 'autogenerate' support
|
# for 'autogenerate' support
|
||||||
from app.db.base import Base
|
|
||||||
target_metadata = Base.metadata
|
target_metadata = Base.metadata
|
||||||
|
|
||||||
# other values from the config, defined by the needs of env.py,
|
# other values from the config, defined by the needs of env.py,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user