From 87773ed8c0e122684c8cd69a07b706dbf92af870 Mon Sep 17 00:00:00 2001 From: Tom Chapman Date: Fri, 30 Aug 2024 11:22:47 -0700 Subject: [PATCH] order decision maker drop down by name --- epictrack-api/src/api/models/staff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epictrack-api/src/api/models/staff.py b/epictrack-api/src/api/models/staff.py index 3d353058e..41840192b 100644 --- a/epictrack-api/src/api/models/staff.py +++ b/epictrack-api/src/api/models/staff.py @@ -15,7 +15,7 @@ from typing import List -from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, func, DateTime +from sqlalchemy import Boolean, Column, ForeignKey, Integer, String, asc, func, DateTime from sqlalchemy.orm import column_property, relationship from api.models.base_model import BaseModelVersioned @@ -69,7 +69,7 @@ def find_active_staff_by_positions(cls, position_ids: List[int]): """Return active staffs by position ids.""" return cls.query.filter( Staff.position_id.in_(position_ids), Staff.is_active.is_(True) - ) + ).order_by(asc(Staff.first_name), asc(Staff.last_name)) @classmethod def find_all_active_staff(cls):