Adding scope import
This commit is contained in:
1 parent
cda15df2ed
commit
69cbfa2d3f
18 files changed
+1165
-3
No files matched your search
@@ -12,6 +12,13 @@ async def get(db: AsyncSession, augmented_part_id: int) -> AugmentedPart | None:
|
||||
return await db.get(AugmentedPart, augmented_part_id)
|
||||
|
||||
|
||||
async def get_by_sku(db: AsyncSession, sku: str) -> AugmentedPart | None:
|
||||
result = await db.execute(
|
||||
select(AugmentedPart).where(AugmentedPart.sku == sku).order_by(AugmentedPart.id)
|
||||
)
|
||||
return result.scalars().first()
|
||||
|
||||
|
||||
async def list_all(
|
||||
db: AsyncSession, skip: int = 0, limit: int = 100
|
||||
) -> list[AugmentedPart]:
|
||||
|
||||
Reference in new issue
Block a user