未知(继上次中断)
This commit is contained in:
@@ -51,7 +51,10 @@ async def list_feasibilities(
|
||||
study_id: uuid.UUID,
|
||||
skip: int = 0,
|
||||
limit: int = 100,
|
||||
site_ids: set[uuid.UUID] | None = None,
|
||||
) -> Sequence[StartupFeasibility]:
|
||||
if site_ids is not None and not site_ids:
|
||||
return []
|
||||
stmt = (
|
||||
select(StartupFeasibility)
|
||||
.where(StartupFeasibility.study_id == study_id)
|
||||
@@ -59,6 +62,8 @@ async def list_feasibilities(
|
||||
.offset(skip)
|
||||
.limit(limit)
|
||||
)
|
||||
if site_ids is not None:
|
||||
stmt = stmt.where(StartupFeasibility.site_id.in_(site_ids))
|
||||
result = await db.execute(stmt)
|
||||
return result.scalars().all()
|
||||
|
||||
@@ -111,7 +116,10 @@ async def list_ethics(
|
||||
study_id: uuid.UUID,
|
||||
skip: int = 0,
|
||||
limit: int = 100,
|
||||
site_ids: set[uuid.UUID] | None = None,
|
||||
) -> Sequence[StartupEthics]:
|
||||
if site_ids is not None and not site_ids:
|
||||
return []
|
||||
stmt = (
|
||||
select(StartupEthics)
|
||||
.where(StartupEthics.study_id == study_id)
|
||||
@@ -119,6 +127,8 @@ async def list_ethics(
|
||||
.offset(skip)
|
||||
.limit(limit)
|
||||
)
|
||||
if site_ids is not None:
|
||||
stmt = stmt.where(StartupEthics.site_id.in_(site_ids))
|
||||
result = await db.execute(stmt)
|
||||
return result.scalars().all()
|
||||
|
||||
@@ -168,7 +178,10 @@ async def list_kickoffs(
|
||||
study_id: uuid.UUID,
|
||||
skip: int = 0,
|
||||
limit: int = 100,
|
||||
site_ids: set[uuid.UUID] | None = None,
|
||||
) -> Sequence[KickoffMeeting]:
|
||||
if site_ids is not None and not site_ids:
|
||||
return []
|
||||
stmt = (
|
||||
select(KickoffMeeting)
|
||||
.where(KickoffMeeting.study_id == study_id)
|
||||
@@ -176,6 +189,8 @@ async def list_kickoffs(
|
||||
.offset(skip)
|
||||
.limit(limit)
|
||||
)
|
||||
if site_ids is not None:
|
||||
stmt = stmt.where(KickoffMeeting.site_id.in_(site_ids))
|
||||
result = await db.execute(stmt)
|
||||
return result.scalars().all()
|
||||
|
||||
@@ -227,7 +242,10 @@ async def list_training_authorizations(
|
||||
study_id: uuid.UUID,
|
||||
skip: int = 0,
|
||||
limit: int = 200,
|
||||
site_names: set[str] | None = None,
|
||||
) -> Sequence[TrainingAuthorization]:
|
||||
if site_names is not None and not site_names:
|
||||
return []
|
||||
stmt = (
|
||||
select(TrainingAuthorization)
|
||||
.where(TrainingAuthorization.study_id == study_id)
|
||||
@@ -235,6 +253,8 @@ async def list_training_authorizations(
|
||||
.offset(skip)
|
||||
.limit(limit)
|
||||
)
|
||||
if site_names is not None:
|
||||
stmt = stmt.where(TrainingAuthorization.site_name.in_(site_names))
|
||||
result = await db.execute(stmt)
|
||||
return result.scalars().all()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user