From e8b971d2bc47ceef8993f7cb4745bdb07ccf2a5c Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 29 Sep 2009 14:56:12 -0400 Subject: [PATCH] update for revision 77, add tobias to credits --- README.rst | 10 ++++++++-- datastore_mongo_stub.py | 2 ++ gae_patch.txt => gae_patch.diff | 25 ++++++++++++++----------- test/test_site/index.yaml | 6 +++--- 4 files changed, 27 insertions(+), 16 deletions(-) rename gae_patch.txt => gae_patch.diff (70%) diff --git a/README.rst b/README.rst index eb60e31..88af60b 100644 --- a/README.rst +++ b/README.rst @@ -54,7 +54,7 @@ To apply the patch, do the following from a command line:: $ cd googleappengine-read-only $ cd python/ # need to do this if you checked out all the different AE languages - $ patch -p0 < gae_patch.txt + $ patch -p0 < gae_patch.diff you should see output similar to:: @@ -128,4 +128,10 @@ Other Notes see if it should create an index a query is performed. - Index creation ignores the "Ancestor" option. This option would just create an - index on '_id', which (soon) MongoDB creates automatically anyway. + index on '_id', which MongoDB creates automatically anyway. + +Credits +======= +- Tobias Rodäbel + + - Fix for newer versions of AppEngine diff --git a/datastore_mongo_stub.py b/datastore_mongo_stub.py index 30933a1..a049e74 100755 --- a/datastore_mongo_stub.py +++ b/datastore_mongo_stub.py @@ -493,6 +493,8 @@ def _Dynamic_Next(self, next_request, query_result): 'Cursor %d not found' % cursor) count = next_request.count() + if count == 0: + count = 1 for _ in range(count): try: query_result.result_list().append(self.__entity_for_mongo_document(cursor.next())) diff --git a/gae_patch.txt b/gae_patch.diff similarity index 70% rename from gae_patch.txt rename to gae_patch.diff index 202a728..0f97f44 100644 --- a/gae_patch.txt +++ b/gae_patch.diff @@ -1,10 +1,10 @@ Index: dev_appserver.py =================================================================== ---- dev_appserver.py (revision 46) -+++ dev_appserver.py (working copy) +--- dev_appserver.py (revision 77) ++++ dev_appserver.py (working copy) @@ -37,6 +37,7 @@ SCRIPT_DIR = os.path.join(DIR_PATH, 'google', 'appengine', 'tools') - + EXTRA_PATHS = [ + "PATH/TO/MONGO-APPENGINE-CONNECTOR/DIRECTORY", DIR_PATH, @@ -12,9 +12,9 @@ Index: dev_appserver.py os.path.join(DIR_PATH, 'lib', 'django'), Index: google/appengine/tools/dev_appserver.py =================================================================== ---- google/appengine/tools/dev_appserver.py (revision 46) -+++ google/appengine/tools/dev_appserver.py (working copy) -@@ -76,7 +76,7 @@ +--- google/appengine/tools/dev_appserver.py (revision 77) ++++ google/appengine/tools/dev_appserver.py (working copy) +@@ -84,7 +84,7 @@ from google.appengine.api import appinfo from google.appengine.api import croninfo from google.appengine.api import datastore_admin @@ -23,12 +23,15 @@ Index: google/appengine/tools/dev_appserver.py from google.appengine.api import mail_stub from google.appengine.api import urlfetch_stub from google.appengine.api import user_service_stub -@@ -3040,7 +3040,7 @@ - +@@ -3311,9 +3311,8 @@ + apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap() - + - datastore = datastore_file_stub.DatastoreFileStub( +- app_id, datastore_path, history_path, require_indexes=require_indexes, +- trusted=trusted) + datastore = datastore_mongo_stub.DatastoreMongoStub( - app_id, datastore_path, history_path, require_indexes=require_indexes) ++ app_id, datastore_path, history_path, require_indexes=require_indexes) apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', datastore) - + + fixed_login_url = '%s?%s=%%s' % (login_url, diff --git a/test/test_site/index.yaml b/test/test_site/index.yaml index 9b09ab0..aa20828 100644 --- a/test/test_site/index.yaml +++ b/test/test_site/index.yaml @@ -10,11 +10,11 @@ indexes: # automatically uploaded to the admin console when you next deploy # your application using appcfg.py. -# Used 10 times in query history. +# Unused in query history -- copied from input. - kind: Ancestor ancestor: yes -# Used 3 times in query history. +# Unused in query history -- copied from input. - kind: Ancestor2 ancestor: yes @@ -67,7 +67,7 @@ indexes: - name: __key__ direction: desc -# Used once in query history. +# Unused in query history -- copied from input. - kind: TestModel properties: - name: number