Limited how many shops can appear in ?selling
parent
517cb21f14
commit
2557e75a2f
|
@ -134,7 +134,7 @@ class DatabaseInterface:
|
||||||
def find_top_shops_selling_item(self, session, item_name):
|
def find_top_shops_selling_item(self, session, item_name):
|
||||||
expr = ItemListing.name.ilike('%{}%'.format(item_name))
|
expr = ItemListing.name.ilike('%{}%'.format(item_name))
|
||||||
result = session.query(func.min(ItemListing.normalized_price), ItemListing.shop_id).group_by(
|
result = session.query(func.min(ItemListing.normalized_price), ItemListing.shop_id).group_by(
|
||||||
ItemListing.shop_id).filter(expr).order_by(func.min(ItemListing.normalized_price)).all()
|
ItemListing.shop_id).filter(expr).order_by(func.min(ItemListing.normalized_price)).limit(5).all()
|
||||||
|
|
||||||
shop_list = []
|
shop_list = []
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ class Shop(Location):
|
||||||
}
|
}
|
||||||
|
|
||||||
def inv_to_str(self):
|
def inv_to_str(self):
|
||||||
if len(self.inventory.limit(25).all()) != 0:
|
if len(self.inventory.limit(15).all()) != 0:
|
||||||
inv = '\n**Inventory**:'
|
inv = '\n**Inventory**:'
|
||||||
str_format = '{}\n{}'
|
str_format = '{}\n{}'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue