__init__.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Deploy_XXNET_Server 作者: jzp820927 项目源码 文件源码
def __init__(self,
               key_start=None,
               key_end=None,
               direction=None,
               include_start=True,
               include_end=True,
               namespace=None,
               _app=None):
    """Initialize a KeyRange object.

    Args:
      key_start: The starting key for this range (db.Key or ndb.Key).
      key_end: The ending key for this range (db.Key or ndb.Key).
      direction: The direction of the query for this range.
      include_start: Whether the start key should be included in the range.
      include_end: Whether the end key should be included in the range.
      namespace: The namespace for this range. If None then the current
          namespace is used.

    NOTE: If NDB keys are passed in, they are converted to db.Key
    instances before being stored.
    """




    if direction is None:
      direction = KeyRange.ASC
    assert direction in (KeyRange.ASC, KeyRange.DESC)
    self.direction = direction


    if ndb is not None:
      if isinstance(key_start, ndb.Key):
        key_start = key_start.to_old_key()
      if isinstance(key_end, ndb.Key):
        key_end = key_end.to_old_key()
    self.key_start = key_start
    self.key_end = key_end
    self.include_start = include_start
    self.include_end = include_end
    if namespace is not None:
      self.namespace = namespace
    else:
      self.namespace = namespace_manager.get_namespace()
    self._app = _app
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号