示例#1
0
  def _ConvertFilter(self, expression):
    """Translates user-provided filter spec into one our backend understands.

    Args:
      expression: a filter spec to translate
    Returns:
      A tuple of string filter specs. The first is the frontend spec for post
      filtering, the second is a spec that the Datastore Admin API understands.
    """
    operation_rewrite_backend = rewrite_backend.OperationsRewriteBackend()
    return operation_rewrite_backend.Rewrite(expression)
示例#2
0
    def _ConvertFilter(self, expression, args):
        """Translates user-provided filter spec into one our backend understands.

    Args:
      expression: a filter spec to translate
      args: the args namespace object
    Returns:
      A tuple of string filter specs. The first is the frontend spec for post
      filtering, the second is a spec that the Datastore Admin API understands.
    """
        operation_rewrite_backend = rewrite_backend.OperationsRewriteBackend()
        display_info = args.GetDisplayInfo()
        defaults = resource_projection_spec.ProjectionSpec(
            symbols=display_info.transforms, aliases=display_info.aliases)
        return operation_rewrite_backend.Rewrite(expression, defaults=defaults)