示例#1
0
    def delete_projection(self, projection):
        """Deletes a projection.

        """
        check_resource_type(projection, PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            return self._delete("%s%s" % (self.url, projection_id))
    def delete_projection(self, projection):
        """Deletes a projection.

        """
        check_resource_type(projection,
                            PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            return self._delete("%s%s" % (self.url, projection_id))
示例#3
0
    def get_projection(self, projection, query_string=''):
        """Retrieves a projection.

        """
        check_resource_type(projection, PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            return self._get("%s%s" % (self.url, projection_id),
                             query_string=query_string)
示例#4
0
    def update_projection(self, projection, changes):
        """Updates a projection.

        """
        check_resource_type(projection, PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, projection_id), body)
    def get_projection(self, projection, query_string=''):
        """Retrieves a projection.

        """
        check_resource_type(projection,
                            PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            return self._get("%s%s" % (self.url, projection_id),
                             query_string=query_string)
    def update_projection(self, projection, changes):
        """Updates a projection.

        """
        check_resource_type(projection,
                            PROJECTION_PATH,
                            message="A projection id is needed.")
        projection_id = get_projection_id(projection)
        if projection_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, projection_id), body)