def validate_wrap(self, value):
        ''' Checks that ``value`` is a pymongo ``ObjectId`` or a string
            representation of one'''
        if (not isinstance(value, ObjectId)
                and not isinstance(value, basestring)
                and not isinstance(value, bytes)
            ):
            self._fail_validation_type(value, ObjectId)
        if isinstance(value, ObjectId):
            return
        #: bytes
        if len(value) == 12:
            return
        # hex
        if len(value) != 24:
            self._fail_validation(value, 'hex object ID is the wrong length')
def validate_wrap ( self , value ) : if ( not isinstance ( value , ObjectId ) and not isinstance ( value , basestring ) and not isinstance ( value , bytes ) ) : self . _fail_validation_type ( value , ObjectId ) if isinstance ( value , ObjectId ) : return if len ( value ) == 12 : return if len ( value ) != 24 : self . _fail_validation ( value , 'hex object ID is the wrong length' )
Checks that ``value`` is a pymongo ``ObjectId`` or a string
            representation of one