save user queries in redis so that user can refresh the page and still come back to their latest task
This commit is contained in:
parent
a055c92dea
commit
d4b22deda0
7 changed files with 114 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from datetime import datetime, timedelta
|
||||
import logging
|
||||
from data_access import Listing
|
||||
from models.listing import (
|
||||
BuyListing,
|
||||
|
|
@ -13,6 +14,8 @@ from sqlmodel import Sequence, Session, and_, col, select
|
|||
from sqlmodel.sql.expression import SelectOfScalar
|
||||
from tqdm import tqdm
|
||||
|
||||
logger = logging.getLogger("uvicorn.error")
|
||||
|
||||
|
||||
class ListingRepository:
|
||||
engine: Engine
|
||||
|
|
@ -51,7 +54,9 @@ class ListingRepository:
|
|||
|
||||
with Session(self.engine) as session:
|
||||
# query = select(modelListing)
|
||||
return list(session.exec(query).all())
|
||||
rows = list(session.exec(query).all())
|
||||
logging.debug(f"Found {len(rows)} listings")
|
||||
return rows
|
||||
|
||||
def _add_where_from_query_parameters(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue