diff options
Diffstat (limited to 'google-appengine/google/appengine/ext/gql/__init__.py')
-rwxr-xr-x | google-appengine/google/appengine/ext/gql/__init__.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/google-appengine/google/appengine/ext/gql/__init__.py b/google-appengine/google/appengine/ext/gql/__init__.py index 39c0e78..7e5f3d0 100755 --- a/google-appengine/google/appengine/ext/gql/__init__.py +++ b/google-appengine/google/appengine/ext/gql/__init__.py @@ -195,7 +195,7 @@ class GQL(object): else: pass - def Bind(self, args, keyword_args): + def Bind(self, args, keyword_args, cursor=None): """Bind the existing query to the argument list. Assumes that the input args are first positional, then a dictionary. @@ -228,8 +228,10 @@ class GQL(object): query_count = 1 for i in xrange(query_count): - queries.append(datastore.Query(self._entity, _app=self.__app, - keys_only=self._keys_only)) + queries.append(datastore.Query(self._entity, + _app=self.__app, + keys_only=self._keys_only, + cursor=cursor)) logging.log(LOG_LEVEL, 'Binding with %i positional args %s and %i keywords %s' @@ -646,9 +648,7 @@ class GQL(object): """ bind_results = self.Bind(args, keyword_args) - offset = 0 - if self.__offset != -1: - offset = self.__offset + offset = self.offset() if self.__limit == -1: it = bind_results.Run() @@ -675,6 +675,13 @@ class GQL(object): """Return numerical result count limit.""" return self.__limit + def offset(self): + """Return numerical result offset.""" + if self.__offset == -1: + return 0 + else: + return self.__offset + def orderings(self): """Return the result ordering list.""" return self.__orderings |