catalogue operations, db migr and so on.
pre release version.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from sqlalchemy import select, update
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.sql.expression import func
|
||||
from typing import Optional
|
||||
|
||||
@@ -32,13 +32,9 @@ class ProductRepository:
|
||||
async def add_product_file_id(
|
||||
self, session: AsyncSession, product_id: int, *, file_id: str
|
||||
) -> None:
|
||||
stmt = (
|
||||
update(Product)
|
||||
.where(Product.id == product_id)
|
||||
.where(Product.file_id is None)
|
||||
.values(file_id=file_id)
|
||||
)
|
||||
await session.execute(stmt)
|
||||
product = await self.get_product_by_id(session, product_id)
|
||||
product.file_id = file_id
|
||||
|
||||
await session.commit()
|
||||
|
||||
async def search(
|
||||
|
||||
Reference in New Issue
Block a user