App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Classes | Functions | Variables
google.appengine.ext.ndb.metadata Namespace Reference

Classes

class  _BaseMetadata
 
class  EntityGroup
 
class  Kind
 
class  Namespace
 
class  Property
 

Functions

def get_namespaces
 
def get_kinds
 
def get_properties_of_kind
 
def get_representations_of_kind
 
def get_entity_group_version
 

Variables

list __all__
 

Detailed Description

Models and helper functions for access to app's datastore metadata.

These entities cannot be created by users, but are created as results of
__namespace__, __kind__, __property__ and __entity_group__ metadata queries
or gets.

A simplified API is also offered:

ndb.metadata.get_namespaces(): A list of namespace names.
ndb.metadata.get_kinds(): A list of kind names.
ndb.metadata.get_properties_of_kind(kind):
  A list of property names for the given kind name.
ndb.metadata.get_representations_of_kind(kind):
  A dict mapping property names to lists of representation ids.
ndb.metadata.get_entity_group_version(key):
  The version of the entity group containing key (HRD only).

get_kinds(), get_properties_of_kind(), get_representations_of_kind()
implicitly apply to the current namespace.

get_namespaces(), get_kinds(), get_properties_of_kind(),
get_representations_of_kind() have optional start and end arguments to limit the
query to a range of names, such that start <= name < end.

Function Documentation

def google.appengine.ext.ndb.metadata.get_entity_group_version (   key)
Return the version of the entity group containing key.

Args:
  key: a key for an entity group whose __entity_group__ key you want.

Returns:
  The version of the entity group containing key. This version is
  guaranteed to increase on every change to the entity group. The version
  may increase even in the absence of user-visible changes to the entity
  group. May return None if the entity group was never written to.

  On non-HR datatores, this function returns None.
def google.appengine.ext.ndb.metadata.get_kinds (   start = None,
  end = None 
)
Return all kinds in the specified range, for the current namespace.

Args:
  start: only return kinds >= start if start is not None.
  end: only return kinds < end if end is not None.

Returns:
  A list of kind names between the (optional) start and end values.
def google.appengine.ext.ndb.metadata.get_namespaces (   start = None,
  end = None 
)
Return all namespaces in the specified range.

Args:
  start: only return namespaces >= start if start is not None.
  end: only return namespaces < end if end is not None.

Returns:
  A list of namespace names between the (optional) start and end values.
def google.appengine.ext.ndb.metadata.get_properties_of_kind (   kind,
  start = None,
  end = None 
)
Return all properties of kind in the specified range.

NOTE: This function does not return unindexed properties.

Args:
  kind: name of kind whose properties you want.
  start: only return properties >= start if start is not None.
  end: only return properties < end if end is not None.

Returns:
  A list of property names of kind between the (optional) start and end
  values.
def google.appengine.ext.ndb.metadata.get_representations_of_kind (   kind,
  start = None,
  end = None 
)
Return all representations of properties of kind in the specified range.

NOTE: This function does not return unindexed properties.

Args:
  kind: name of kind whose properties you want.
  start: only return properties >= start if start is not None.
  end: only return properties < end if end is not None.

Returns:
  A dictionary mapping property names to its list of representations.

Variable Documentation

list google.appengine.ext.ndb.metadata.__all__
Initial value:
1 = ['Namespace', 'Kind', 'Property', 'EntityGroup',
2  'get_namespaces', 'get_kinds',
3  'get_properties_of_kind', 'get_representations_of_kind',
4  'get_entity_group_version',
5  ]