示例#1
0
    def delete_forecast(self, forecast):
        """Deletes a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            return self._delete("%s%s" % (self.url, forecast_id))
示例#2
0
    def delete_forecast(self, forecast):
        """Deletes a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            return self._delete("%s%s" % (self.url, forecast_id))
示例#3
0
    def update_forecast(self, forecast, changes):
        """Updates a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, forecast_id), body)
示例#4
0
    def get_forecast(self, forecast, query_string=''):
        """Retrieves a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            return self._get("%s%s" % (self.url, forecast_id),
                             query_string=query_string)
示例#5
0
    def update_forecast(self, forecast, changes):
        """Updates a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, forecast_id), body)
示例#6
0
    def get_forecast(self, forecast, query_string=''):
        """Retrieves a forecast.

        """
        check_resource_type(forecast, FORECAST_PATH,
                            message="A forecast id is needed.")
        forecast_id = get_forecast_id(forecast)
        if forecast_id:
            return self._get("%s%s" % (self.url, forecast_id),
                             query_string=query_string)