flip_api.utils.project_manager

Functions

get_project_by_id(...)

Get project by ID from database, ignoring soft-deleted ones.

has_project_status(→ bool)

Check if a project has the specified status

Module Contents

flip_api.utils.project_manager.get_project_by_id(project_id: uuid.UUID, db: sqlmodel.Session) flip_api.db.models.main_models.Projects | None

Get project by ID from database, ignoring soft-deleted ones.

Parameters:
  • project_id (UUID) – The ID of the project to retrieve.

  • db (Session) – The SQLModel session to use for database operations.

Returns:

The project object if found, otherwise None.

Return type:

Projects | None

flip_api.utils.project_manager.has_project_status(project_id: uuid.UUID, status: flip_api.domain.schemas.status.ProjectStatus, db: sqlmodel.Session) bool

Check if a project has the specified status

Parameters:
  • project_id (UUID) – The ID of the project to check

  • status (ProjectStatus) – The status to check against the project

  • db (Session) – The database session to use for the query

Returns:

True if the project has the specified status, False otherwise

Return type:

bool