range_query = """SELECT e.id enterprise_id, pi.fixed_price FROM etourism_enterprise e, product_pricelist_item pi, product_pricelist p WHERE p.enterprise_id = e.id AND pi.pricelist_id=p.id AND NOW() BETWEEN p.start_date AND p.end_date AND pi.fixed_price BETWEEN {min} AND {max} ORDER BY pi.fixed_price,e.id"""
min_max_range_query = """SELECT MIN(fixed_price) min_price, MAX(fixed_price) max_price  FROM ({range_query}) as price_range"""