restore beahvior in gae that if no limitby, returns iterator

This commit is contained in:
mdipierro
2014-03-31 00:19:04 -05:00
parent 52b55889dd
commit 8d648f6137
3 changed files with 17 additions and 16 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ env:
- DB=mysql://root:@localhost/test_w2p - DB=mysql://root:@localhost/test_w2p
- DB=postgres://postgres:@localhost/test_w2p - DB=postgres://postgres:@localhost/test_w2p
- DB=google:datastore - DB=google:datastore
- DB=google:datastore+ndb # - DB=google:datastore+ndb
- DB=mongodb://mongodb:mongodb@localhost/test_w2p - DB=mongodb://mongodb:mongodb@localhost/test_w2p
- DB=imap://imap:imap@localhost:993 - DB=imap://imap:imap@localhost:993
before_script: before_script:
@@ -44,8 +44,8 @@ matrix:
env: DB=google:datastore env: DB=google:datastore
- python: '2.6' - python: '2.6'
env: DB=google:datastore env: DB=google:datastore
- python: '2.6' # - python: '2.6'
env: DB=google:datastore+ndb # env: DB=google:datastore+ndb
script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage script: export COVERAGE_PROCESS_START=gluon/tests/coverage.ini; ./web2py.py --run_system_tests --with_coverage
+1 -1
View File
@@ -1 +1 @@
Version 2.9.5-trunk+timestamp.2014.03.31.00.06.17 Version 2.9.5-trunk+timestamp.2014.03.31.00.18.01
+13 -12
View File
@@ -5223,20 +5223,21 @@ class GoogleDatastoreAdapter(NoSQLAdapter):
if args_get('limitby', None): if args_get('limitby', None):
(lmin, lmax) = attributes['limitby'] (lmin, lmax) = attributes['limitby']
limit, fetch_args = lmax-lmin, {'offset':lmin,'keys_only':True} limit, fetch_args = lmax-lmin, {'offset':lmin,'keys_only':True}
else:
limit, fetch_args = self.MAX_FETCH_LIMIT, {'offset':0,'keys_only':True}
if self.use_ndb: if self.use_ndb:
keys, cursor, more = query.fetch_page(limit,**fetch_args) keys, cursor, more = query.fetch_page(limit,**fetch_args)
items = ndb.get_multi(keys) items = ndb.get_multi(keys)
else:
keys = query.fetch(limit, **fetch_args)
items = gae.get(keys)
cursor = query.cursor()
#cursor is only useful if there was a limit and we didn't return
# all results
if args_get('reusecursor'):
db['_lastcursor'] = cursor
else: else:
keys = query.fetch(limit, **fetch_args) # if a limit is not specified, always return an iterator
items = gae.get(keys) rows = query
cursor = query.cursor()
#cursor is only useful if there was a limit and we didn't return
# all results
if args_get('reusecursor'):
db['_lastcursor'] = cursor
return (items, tablename, projection or db[tablename].fields) return (items, tablename, projection or db[tablename].fields)