def get_all_areas(): """ Returns a list of dictionaries representing all the rows in the area table. """ return request_or_fail("/area")
def get_measurements_for_location(location_id): """ Return a list of dictionaries giving the measurement rows for the given location. """ return request_or_fail("/location/" + str(location_id) + "/measurement")
def get_categories_for_area(area_id): """ Return a list of rows from the category table that all contain the given area. """ return request_or_fail("/area/" + str(area_id) + "/category")
def number_of_locations_by_area(area_id): """ Returns the number of locations for the given area. """ return request_or_fail("/area/" + str(area_id) + "/number_locations")
def get_locations_for_area(area_id): """ Return a list of dictionaries giving the locations for the given area. """ return request_or_fail("/area/" + str(area_id) + "/location")
def number_of_locations_by_area(area_id): """ Returns the number of locations for the given area. """ return request_or_fail("/area/" + str(area_id) + "/number_locations")
def get_average_measurements_for_area(area_id): """ Returns the average value of all measurements for all locations in the given area. Returns None if there are no measurements. """ return request_or_fail("/area/" + str(area_id) + "/average_measurement")
def get_average_measurements_for_area(area_id): """ Returns the average value of all measurements for all locations in the given area. Returns None if there are no measurements. """ return request_or_fail("/area/" + str(area_id) + "/average_measurement")
def get_all_areas(): """ Returns a list of dictionaries representing all the rows in the area table. """ return request_or_fail("/area")
def get_categories_for_area(area_id): """ Return a list of rows from the category table that all contain the given area. """ return request_or_fail("/area/" + str(area_id) + "/category")
def get_measurements_for_location(location_id): """ Return a list of dictionaries giving the measurement rows for the given location. """ return request_or_fail("/location/" + str(location_id) + "/measurement")
def get_locations_for_area(area_id): """ Return a list of dictionaries giving the locations for the given area. """ return request_or_fail("/area/" + str(area_id) + "/location")