Blobstore¶
Provides an ndb
interface for the blob store.
Initially, the blob store was an App Engine specific API for Google Cloud Storage.
No longer supported.
- class google.cloud.ndb.blobstore.BlobKeyProperty(name=None, indexed=None, repeated=None, required=None, default=None, choices=None, validator=None, verbose_name=None, write_empty_list=None)[source]¶
Bases:
google.cloud.ndb.model.Property
A property containing
BlobKey
values.- _validate(value)[source]¶
Validate a
value
before setting it.- Parameters
value (BlobKey) – The value to check.
- Raises
BadValueError – If
value
is not aBlobKey
.
- IN(value, server_op=False)¶
For the
in
comparison operator.The
in
operator cannot be overloaded in the way we want to, so we define a method. For example:Employee.query(Employee.rank.IN([4, 5, 6]))
Note that the method is called
_IN()
but may normally be invoked asIN()
;_IN()
is provided for the case that aStructuredProperty
refers to a model that has a property namedIN
.- Parameters
value (Iterable[Any]) – The set of values that the property value must be contained in.
- Returns
A node corresponding to the desired in filter.
If
value
is empty, this will return aFalseNode
If
len(value) == 1
, this will return aFilterNode
Otherwise, this will return a
DisjunctionNode
- Return type
Union[DisjunctionNode, FilterNode, FalseNode]
- Raises
BadFilterError – If the current property is not indexed.
BadArgumentError – If
value
is not a basic container (list
,tuple
,set
orfrozenset
).
- NOT_IN(value, server_op=False)¶
.FilterNode: Represents the
not_in
filter.
- __delete__(entity)¶
Descriptor protocol: delete the value from the entity.
- Parameters
entity (Model) – An entity to delete a value from.
- __eq__(value)¶
FilterNode: Represents the
=
comparison.
- __ge__(value)¶
FilterNode: Represents the
>=
comparison.
- __get__(entity, unused_cls=None)¶
Descriptor protocol: get the value from the entity.
- __gt__(value)¶
FilterNode: Represents the
>
comparison.
- __le__(value)¶
FilterNode: Represents the
<=
comparison.
- __lt__(value)¶
FilterNode: Represents the
<
comparison.
- __ne__(value)¶
FilterNode: Represents the
!=
comparison.
- __neg__()¶
Return a descending sort order on this property.
For example:
Employee.query().order(-Employee.rank)
- __pos__()¶
Return an ascending sort order on this property.
Note that this is redundant but provided for consistency with
__neg__()
. For example, the following two are equivalent:Employee.query().order(+Employee.rank) Employee.query().order(Employee.rank)
- __repr__()¶
Return a compact unambiguous string representation of a property.
This cycles through all stored attributes and displays the ones that differ from the default values.
- google.cloud.ndb.blobstore.get(*args, **kwargs)¶
- google.cloud.ndb.blobstore.get_async(*args, **kwargs)¶
- google.cloud.ndb.blobstore.get_multi(*args, **kwargs)¶
- google.cloud.ndb.blobstore.get_multi_async(*args, **kwargs)¶