|
list | __all__ |
|
| Error = blobstore.Error |
|
| InternalError = blobstore.InternalError |
|
| BlobFetchSizeTooLargeError = blobstore.BlobFetchSizeTooLargeError |
|
| BlobNotFoundError = blobstore.BlobNotFoundError |
|
| _CreationFormatError = blobstore._CreationFormatError |
|
| DataIndexOutOfRangeError = blobstore.DataIndexOutOfRangeError |
|
| PermissionDeniedError = blobstore.PermissionDeniedError |
|
| BlobInfoParseError = ext_blobstore.BlobInfoParseError |
|
| BlobKey = blobstore.BlobKey |
|
| BLOB_INFO_KIND = blobstore.BLOB_INFO_KIND |
|
| BLOB_MIGRATION_KIND = blobstore.BLOB_MIGRATION_KIND |
|
| BLOB_KEY_HEADER = blobstore.BLOB_KEY_HEADER |
|
| BLOB_RANGE_HEADER = blobstore.BLOB_RANGE_HEADER |
|
| MAX_BLOB_FETCH_SIZE = blobstore.MAX_BLOB_FETCH_SIZE |
|
| UPLOAD_INFO_CREATION_HEADER = blobstore.UPLOAD_INFO_CREATION_HEADER |
|
| BlobKeyProperty = model.BlobKeyProperty |
|
| get = BlobInfo.get |
|
| get_async = BlobInfo.get_async |
|
| get_multi = BlobInfo.get_multi |
|
| get_multi_async = BlobInfo.get_multi_async |
|
NDB interface for Blobstore.
This currently builds on google.appengine.ext.blobstore and provides a
similar API. The main API differences:
- BlobInfo is an actual Model subclass rather than a pseudo-model class.
To query, use BlobInfo.query() and its documented properties. Other
changes:
- The kind is '__BlobInfo__' (BLOB_INFO_KIND).
- key() is a method returning a BlobKey instance.
- put() and friends are disabled.
- Added class methods get() and friends.
- Added instance methods delete() and friends, and open().
- Instead of BlobReferenceProperty, there's BlobKeyProperty.
- There is no create_rpc() function. Instead, functions and methods
take keyword arguments to specify deadline, callback, and (in some
case) datastore options.
- APIs (get() and delete()) that in ext.blobstore take either a blob
key or a list of blob keys are split into two: one that takes a blob
key and one that takes a list of blob keys, the latter having a name
ending in _multi.
- The following APIs have a synchronous and an async version:
- BlobInfo.get()
- BlobInfo.delete()
- create_upload_url()
- get()
- get_multi()
- delete()
- delete_multi()
- fetch_data()
def google.appengine.ext.ndb.blobstore.fetch_data |
( |
|
blob, |
|
|
|
start_index, |
|
|
|
end_index, |
|
|
|
options |
|
) |
| |
Fetch data for blob.
Fetches a fragment of a blob up to MAX_BLOB_FETCH_SIZE in length. Attempting
to fetch a fragment that extends beyond the boundaries of the blob will return
the amount of data from start_index until the end of the blob, which will be
a smaller size than requested. Requesting a fragment which is entirely
outside the boundaries of the blob will return empty string. Attempting
to fetch a negative index will raise an exception.
Args:
blob: BlobInfo, BlobKey, str or unicode representation of BlobKey of
blob to fetch data from.
start_index: Start index of blob data to fetch. May not be negative.
end_index: End index (inclusive) of blob data to fetch. Must be
>= start_index.
**options: Options for create_rpc().
Returns:
str containing partial data of blob. If the indexes are legal but outside
the boundaries of the blob, will return empty string.
Raises:
TypeError if start_index or end_index are not indexes. Also when blob
is not a string, BlobKey or BlobInfo.
DataIndexOutOfRangeError when start_index < 0 or end_index < start_index.
BlobFetchSizeTooLargeError when request blob fragment is larger than
MAX_BLOB_FETCH_SIZE.
BlobNotFoundError when blob does not exist.