Exemplo n.º 1
0
 async def list_venues(self, *, city: str) -> AsyncIterator[models.Venue]:
     result = await self._conn.stream(sqlalchemy.text(LIST_VENUES), {"p1": city})
     async for row in result:
         yield models.Venue(
             id=row[0],
             status=row[1],
             statuses=row[2],
             slug=row[3],
             name=row[4],
             city=row[5],
             spotify_playlist=row[6],
             songkick_id=row[7],
             tags=row[8],
             created_at=row[9],
         )
Exemplo n.º 2
0
 async def get_venue(self, *, slug: str, city: str) -> Optional[models.Venue]:
     row = (await self._conn.execute(sqlalchemy.text(GET_VENUE), {"p1": slug, "p2": city})).first()
     if row is None:
         return None
     return models.Venue(
         id=row[0],
         status=row[1],
         statuses=row[2],
         slug=row[3],
         name=row[4],
         city=row[5],
         spotify_playlist=row[6],
         songkick_id=row[7],
         tags=row[8],
         created_at=row[9],
     )