labpack/databases/couchbase.py
def exists(self, doc_id, rev_id=''):
        
        '''
            a method to determine if document exists
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: [optional] string with revision id of document in bucket
        :return: boolean indicating existence of document
        '''

        title = '%s.exists' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            if value:
                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 = None
        if rev_id:
            params = { 'rev': rev_id }
        response = requests.get(url, params=params)
        if not 'error' in response.json():
            return True
        return False

            a method to determine if document exists
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: [optional] string with revision id of document in bucket
        :return: boolean indicating existence of document
        
a method to determine if document exists
a method to determine if document exists
def exists(self, doc_id, rev_id=''):
        title = '%s.exists' % self.__class__.__name__
        input_fields = {
            'doc_id': doc_id,
            'rev_id': rev_id
        }
        for key, value in input_fields.items():
            if value:
                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 = None
        if rev_id:
            params = { 'rev': rev_id }
        response = requests.get(url, params=params)
        if not 'error' in response.json():
            return True
        return False
def exists ( self , doc_id , rev_id = '' ) : title = '%s.exists' % self . __class__ . __name__ input_fields = { 'doc_id' : doc_id , 'rev_id' : rev_id } for key , value in input_fields . items ( ) : if value : 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 = None if rev_id : params = { 'rev' : rev_id } response = requests . get ( url , params = params ) if not 'error' in response . json ( ) : return True return False
a method to determine if document exists
a method to determine if document exists
'''
            a method to determine if document exists
            
        :param doc_id: string with id of document in bucket 
        :param rev_id: [optional] string with revision id of document in bucket
        :return: boolean indicating existence of document
        ''' # validate inputs # send request and construct response
boolean indicating existence of document
boolean indicating existence of document
self
doc_id
string with id of document in bucket
string with id of document in bucket
rev_id
[optional] string with revision id of document in bucket
[ optional ] string with revision id of document in bucket