labpack/databases/couchbase.py
def delete(self, doc_id, rev_id):
    
        '''
            a method to mark a document for deletion
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: string with revision id of document in bucket
        :return: string with id of deleted document
        '''
        
        title = '%s.delete' % self.__class__.__name__
        
    # validate inputs
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
            
    # send request and construct response
        url = self.bucket_url + '/%s' % doc_id
        params = { 'rev': rev_id }
        response = requests.delete(url, params=params)
        if response.status_code not in (200, 201):
            response = response.json()
            raise Exception('%s() error: %s' % (title, response))
        response = response.json()
        doc_id = response['id']
        
        return doc_id

            a method to mark a document for deletion
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: string with revision id of document in bucket
        :return: string with id of deleted document
        
a method to mark a document for deletion
a method to mark a document for deletion
def delete(self, doc_id, rev_id):
        title = '%s.delete' % self.__class__.__name__
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            object_title = '%s(%s=%s)' % (title, key, str(value))
            self.fields.validate(value, '.%s' % key, object_title)
        url = self.bucket_url + '/%s' % doc_id
        params = { 'rev': rev_id }
        response = requests.delete(url, params=params)
        if response.status_code not in (200, 201):
            response = response.json()
            raise Exception('%s() error: %s' % (title, response))
        response = response.json()
        doc_id = response['id']
        return doc_id
def delete ( self , doc_id , rev_id ) : title = '%s.delete' % self . __class__ . __name__ input_fields = { 'doc_id' : doc_id , 'rev_id' : rev_id } for key , value in input_fields . items ( ) : object_title = '%s(%s=%s)' % ( title , key , str ( value ) ) self . fields . validate ( value , '.%s' % key , object_title ) url = self . bucket_url + '/%s' % doc_id params = { 'rev' : rev_id } response = requests . delete ( url , params = params ) if response . status_code not in ( 200 , 201 ) : response = response . json ( ) raise Exception ( '%s() error: %s' % ( title , response ) ) response = response . json ( ) doc_id = response [ 'id' ] return doc_id
a method to mark a document for deletion
a method to mark a document for deletion
'''
            a method to mark a document for deletion
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: string with revision id of document in bucket
        :return: string with id of deleted document
        ''' # validate inputs # send request and construct response
string with id of deleted document
string with id of deleted document
self
doc_id
string with id of document in bucket
string with id of document in bucket
rev_id
string with revision id of document in bucket
string with revision id of document in bucket