Files
ForbiddenStarsApp/backend/app/services/faction_service.py
T

21 lines
542 B
Python

"""Справочники: дополнения и фракции."""
from __future__ import annotations
from sqlmodel import Session, select
from app.models import Expansion, Faction
def list_expansions(session: Session) -> list[Expansion]:
return list(
session.exec(select(Expansion).order_by(Expansion.sort_order)).all()
)
def list_factions(session: Session) -> list[Faction]:
return list(
session.exec(
select(Faction).order_by(Faction.expansion_id, Faction.sort_order)
).all()
)