diff --git a/geoffrey/DatabaseInterface.py b/geoffrey/DatabaseInterface.py index 4e3321d..ff248ab 100644 --- a/geoffrey/DatabaseInterface.py +++ b/geoffrey/DatabaseInterface.py @@ -134,7 +134,7 @@ class DatabaseInterface: def find_top_shops_selling_item(self, session, item_name): expr = ItemListing.name.ilike('%{}%'.format(item_name)) 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 = [] diff --git a/geoffrey/DatabaseModels.py b/geoffrey/DatabaseModels.py index cf03bb9..ed0b537 100644 --- a/geoffrey/DatabaseModels.py +++ b/geoffrey/DatabaseModels.py @@ -253,7 +253,7 @@ class Shop(Location): } def inv_to_str(self): - if len(self.inventory.limit(25).all()) != 0: + if len(self.inventory.limit(15).all()) != 0: inv = '\n**Inventory**:' str_format = '{}\n{}'