Python google.appengine.ext.ndb 模块,ComputedProperty() 实例源码

我们从Python开源项目中,提取了以下25个代码示例,用于说明如何使用google.appengine.ext.ndb.ComputedProperty()

项目:Tinychat-Bot--Discontinued    作者:Tinychat    | 项目源码 | 文件源码
def getCustomProperties(self):
        props = {}
        # list of property names that are considered read only
        read_only_props = []
        repeated_props = {}
        non_repeated_props = {}
        # list of property names that are computed
        computed_props = {}

        for name, prop in self.klass._properties.iteritems():
            props[name] = prop

            if prop._repeated:
                repeated_props[name] = prop
            else:
                non_repeated_props[name] = prop

            if isinstance(prop, ndb.ComputedProperty):
                computed_props[name] = prop

        if issubclass(self.klass, polymodel.PolyModel):
            del props['class']

        # check if the property is a defined as a computed property. These
        # types of properties are read-only
        for name, value in self.klass.__dict__.iteritems():
            if isinstance(value, ndb.ComputedProperty):
                read_only_props.append(name)

        self.encodable_properties.update(props.keys())
        self.decodable_properties.update(props.keys())
        self.readonly_attrs.update(read_only_props)

        if computed_props:
            self.decodable_properties.difference_update(computed_props.keys())

        self.model_properties = props or None
        self.repeated_properties = repeated_props or None
        self.non_repeated_properties = non_repeated_props or None
        self.computed_properties = computed_props or None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:Sci-Finder    作者:snverse    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:FileStoreGAE    作者:liantian-cn    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:python-group-proj    作者:Sharcee    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:start    作者:argeweb    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:start    作者:argeweb    | 项目源码 | 文件源码
def convert__ClassKeyProperty(self, model, prop, kwargs):
            """Returns a form field for a ``ndb.ComputedProperty``."""
            return None
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:Sudoku-Solver    作者:ayush1997    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:gardenbot    作者:GoestaO    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:micro-blog    作者:nickChenyx    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:python-flask-security    作者:weinbergdavid    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:Lixiang_zhaoxin    作者:hejaxian    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:flow-dashboard    作者:onejgordon    | 项目源码 | 文件源码
def clone_entity(e, **extra_args):
    from google.appengine.ext import ndb
    klass = e.__class__
    props = dict((v._code_name, v.__get__(e, klass)) for v in klass._properties.itervalues() if type(v) is not ndb.ComputedProperty)
    props.update(extra_args)
    return klass(**props)
项目:flask    作者:bobohope    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:raw-data-repository    作者:all-of-us    | 项目源码 | 文件源码
def update_model(old_model, new_model):
  """Updates a model.
  For all fields that are set in new_model, copy them into old_model.

  Args:
    old_model: The ndb model object retrieved from the datastore.
    new_model_dict: A json object containing the new values.
  """

  for k, v in new_model.to_dict().iteritems():
    if type(getattr(type(new_model), k)) != ndb.ComputedProperty and v is not None:
      setattr(old_model, k, v)
项目:Hawkeye    作者:tozhengxq    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def convert_ComputedProperty(self, model, prop, kwargs):
        """Returns a form field for a ``ndb.ComputedProperty``."""
        return None