def is_value_exist(title, property_key): value = ProductPropertyValue.query()\ .filter(ProductPropertyValue.property == property_key)\ .filter(ProductPropertyValue.title == title) if value.count(): return True return False
def get_values(request, property_key): property_obj = ProductProperty.get_by_id(property_key) values = ProductPropertyValue.query( ProductPropertyValue.property == property_obj.key ) values = [value.to_json() for value in values] return render_json_response(values)