(self, content, name=None, content_type=None,
                                content_length=None, domain=None, type_code=None)
Queue attachment to be persisted on save

        WARNING this loads the entire blob content into memory. Use of
        this method is discouraged:

        - Generally it is bad practice to load large blobs into memory
          in their entirety. Ideally blobs should be streamed between
          the client and the blob database.
        - JSON serialization becomes less efficient because blobs are
          base-64 encoded, requiring even more memory.

        This method takes the same parameters as `put_attachment`.
Queue attachment to be persisted on save
Queue attachment to be persisted on save
def deferred_put_attachment(self, content, name=None, content_type=None,
                                content_length=None, domain=None, type_code=None):
        """Queue attachment to be persisted on save

        WARNING this loads the entire blob content into memory. Use of
        this method is discouraged:

        - Generally it is bad practice to load large blobs into memory
          in their entirety. Ideally blobs should be streamed between
          the client and the blob database.
        - JSON serialization becomes less efficient because blobs are
          base-64 encoded, requiring even more memory.

        This method takes the same parameters as `put_attachment`.
        """
        if isinstance(content, str):
            content = content.encode('utf-8')
        elif not isinstance(content, bytes):
            content = content.read()
        if self._deferred_blobs is None:
            self._deferred_blobs = {}
        length = len(content) if content_length is None else content_length
        self._deferred_blobs[name] = {
            "content": content,
            "content_type": content_type,
            "content_length": length,
            "domain": domain or getattr(self, "domain", None),
            "type_code": type_code,
        }
def deferred_put_attachment ( self , content , name = None , content_type = None , content_length = None , domain = None , type_code = None ) : if isinstance ( content , str ) : content = content . encode ( 'utf-8' ) elif not isinstance ( content , bytes ) : content = content . read ( ) if self . _deferred_blobs is None : self . _deferred_blobs = { } length = len ( content ) if content_length is None else content_length self . _deferred_blobs [ name ] = { "content" : content , "content_type" : content_type , "content_length" : length , "domain" : domain or getattr ( self , "domain" , None ) , "type_code" : type_code , }