App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Static Public Member Functions | List of all members
google.appengine.api.datastore.Entity Class Reference
Inheritance diagram for google.appengine.api.datastore.Entity:
google.appengine.api.datastore_entities.GdKind google.appengine.api.datastore_entities.Contact google.appengine.api.datastore_entities.Event google.appengine.api.datastore_entities.Message

Public Member Functions

def __init__
 
def app
 
def namespace
 
def kind
 
def is_saved
 
def is_projection
 
def key
 
def parent
 
def entity_group
 
def unindexed_properties
 
def set_unindexed_properties
 
def __setitem__
 
def setdefault
 
def update
 
def copy
 
def ToXml
 
def ToPb
 

Static Public Member Functions

def FromPb
 

Detailed Description

A datastore entity.

Includes read-only accessors for app id, kind, and primary key. Also
provides dictionary-style access to properties.

Constructor & Destructor Documentation

def google.appengine.api.datastore.Entity.__init__ (   self,
  kind,
  parent = None,
  _app = None,
  name = None,
  id = None,
  unindexed_properties = [],
  namespace = None,
  kwds 
)
Constructor. Takes the kind and transaction root, which cannot be
changed after the entity is constructed, and an optional parent. Raises
BadArgumentError or BadKeyError if kind is invalid or parent is not an
existing Entity or Key in the datastore.

Args:
  # this entity's kind
  kind: string
  # if provided, this entity's parent. Its key must be complete.
  parent: Entity or Key
  # if provided, this entity's name.
  name: string
  # if provided, this entity's id.
  id: integer
  # if provided, a sequence of property names that should not be indexed
  # by the built-in single property indices.
  unindexed_properties: list or tuple of strings
  namespace: string
  # if provided, overrides the default namespace_manager setting.

Member Function Documentation

def google.appengine.api.datastore.Entity.__setitem__ (   self,
  name,
  value 
)
Implements the [] operator. Used to set property value(s).

If the property name is the empty string or not a string, raises
BadPropertyError. If the value is not a supported type, raises
BadValueError.
def google.appengine.api.datastore.Entity.app (   self)
Returns the name of the application that created this entity, a
string or None if not set.
def google.appengine.api.datastore.Entity.copy (   self)
The copy method is not supported.
def google.appengine.api.datastore.Entity.entity_group (   self)
Returns this entity's entity group as a Key.

Note that the returned Key will be incomplete if this is a a root entity
and its key is incomplete.
def google.appengine.api.datastore.Entity.FromPb (   pb,
  validate_reserved_properties = True,
  default_kind = '<not specified>' 
)
static
Static factory method. Returns the Entity representation of the
given protocol buffer (datastore_pb.Entity).

Args:
  pb: datastore_pb.Entity or str encoding of a datastore_pb.Entity
  validate_reserved_properties: deprecated
  default_kind: str, the kind to use if the pb has no key.

Returns:
  Entity: the Entity representation of pb
def google.appengine.api.datastore.Entity.is_projection (   self)
Returns if this entity is a projection from full entity.

Projected entities:
- may not contain all properties from the original entity;
- only contain single values for lists;
- may not contain values with the same type as the original entity.
def google.appengine.api.datastore.Entity.is_saved (   self)
Returns if this entity has been saved to the datastore.
def google.appengine.api.datastore.Entity.key (   self)
Returns this entity's primary key, a Key instance.
def google.appengine.api.datastore.Entity.kind (   self)
Returns this entity's kind, a string.
def google.appengine.api.datastore.Entity.namespace (   self)
Returns the namespace of this entity, a string or None.
def google.appengine.api.datastore.Entity.parent (   self)
Returns this entity's parent, as a Key. If this entity has no parent,
returns None.
def google.appengine.api.datastore.Entity.setdefault (   self,
  name,
  value 
)
If the property exists, returns its value. Otherwise sets it to value.

If the property name is the empty string or not a string, raises
BadPropertyError. If the value is not a supported type, raises
BadValueError.
def google.appengine.api.datastore.Entity.ToPb (   self)
Converts this Entity to its protocol buffer representation.

Returns:
  entity_pb.Entity
def google.appengine.api.datastore.Entity.ToXml (   self)
Returns an XML representation of this entity. Atom and gd:namespace
properties are converted to XML according to their respective schemas. For
more information, see:

  http://www.atomenabled.org/developers/syndication/
  http://code.google.com/apis/gdata/common-elements.html

This is *not* optimized. It shouldn't be used anywhere near code that's
performance-critical.
def google.appengine.api.datastore.Entity.unindexed_properties (   self)
Returns this entity's unindexed properties, as a frozenset of strings.
def google.appengine.api.datastore.Entity.update (   self,
  other 
)
Updates this entity's properties from the values in other.

If any property name is the empty string or not a string, raises
BadPropertyError. If any value is not a supported type, raises
BadValueError.

The documentation for this class was generated from the following file: