This commit is contained in:
Tiago vasconcelos 2022-09-15 15:52:08 +01:00
parent ad98cb0d45
commit ee47575431
3 changed files with 15 additions and 10 deletions

View file

@ -201,7 +201,10 @@ async def get_diagonalley_stalls(wallet_ids: Union[str, List[str]]) -> List[Stal
)
return [Stalls(**row) for row in rows]
async def get_diagonalley_stalls_by_ids(stall_ids: Union[str, List[str]]) -> List[Stalls]:
async def get_diagonalley_stalls_by_ids(
stall_ids: Union[str, List[str]]
) -> List[Stalls]:
q = ",".join(["?"] * len(stall_ids))
rows = await db.fetchall(
f"SELECT * FROM diagonalley.stalls WHERE id IN ({q})", (*stall_ids,)

View file

@ -72,7 +72,9 @@ async def display(request: Request, market_id):
stalls = await get_diagonalley_market_stalls(market_id)
stalls_ids = [stall.id for stall in stalls]
products = [product.dict() for product in await get_diagonalley_products(stalls_ids)]
products = [
product.dict() for product in await get_diagonalley_products(stalls_ids)
]
return diagonalley_renderer().TemplateResponse(
"diagonalley/market.html",
@ -80,6 +82,6 @@ async def display(request: Request, market_id):
"request": request,
"market": market,
"stalls": [stall.dict() for stall in stalls],
"products": products
"products": products,
},
)