refactor: renamed built_in_modules into modules
This commit is contained in:
18
repositories/module.py
Normal file
18
repositories/module.py
Normal file
@ -0,0 +1,18 @@
|
||||
from models import Board, Module
|
||||
from repositories.mixins import *
|
||||
|
||||
|
||||
class ModuleRepository(
|
||||
BaseRepository,
|
||||
RepGetAllMixin[Module],
|
||||
):
|
||||
entity_class = Module
|
||||
|
||||
def _process_get_all_stmt_with_args(self, stmt: Select, *args) -> Select:
|
||||
project_id = args[0]
|
||||
return stmt.where(Board.project_id == project_id).order_by(Board.lexorank)
|
||||
|
||||
async def get_by_ids(self, ids: list[int]) -> list[Module]:
|
||||
stmt = select(Module).where(Module.id.in_(ids))
|
||||
modules = await self.session.scalars(stmt)
|
||||
return modules.all()
|
||||
Reference in New Issue
Block a user