Commits

Alon Burg  committed 369f931 Merge

Merge latest

  • Participants
  • Parent commits e132503, fdff2a9

Comments (0)

Files changed (4)

         if on_production_server:
             self.remote = False
         self.remote_app_id = options.get('REMOTE_APP_ID', appid)
+        self.high_replication = options.get('HIGH_REPLICATION', False)
+        self.domain = options.get('DOMAIN', 'appspot.com')
         self.remote_api_path = options.get('REMOTE_API_PATH', None)
         self.secure_remote_api = options.get('SECURE_REMOTE_API', True)
         self._setup_stubs()
                     self.remote_api_path = handler.url.split('(', 1)[0]
                     break
         self.remote = True
-        remote_url = 'https://%s.appspot.com%s' % (self.remote_app_id,
-                                                   self.remote_api_path)
+        server = '%s.%s' % (self.remote_app_id, self.domain)
+        remote_url = 'https://%s%s' % (server, self.remote_api_path)
         logging.info('Setting up remote_api for "%s" at %s' %
                      (self.remote_app_id, remote_url))
         if not have_appserver:
                   'App Engine Dashboard if you have problems logging in. '
                   'Login is only supported for Google Accounts.\n')
         from google.appengine.ext.remote_api import remote_api_stub
-        remote_api_stub.ConfigureRemoteApi(self.remote_app_id,
-            self.remote_api_path, auth_func, secure=self.secure_remote_api,
+        remote_app_id = self.remote_app_id
+        if self.high_replication:
+            remote_app_id = 's~' + remote_app_id
+        remote_api_stub.ConfigureRemoteApi(remote_app_id,
+            self.remote_api_path, auth_func, servername=server,
+            secure=self.secure_remote_api,
             rpc_server_factory=rpc_server_factory)
         retry_delay = 1
         while retry_delay <= 16:

File db/compiler.py

             value = self.convert_value_for_db(db_type, value)
             if isinstance(value, Text):
                 raise DatabaseError('TextField is not indexed, by default, '
-                                    "so you can't filter on it. "
-                                    'Please add an index definition for the '
-                                    'column "%s" as described here:\n'
+                                    "so you can't filter on it. Please add "
+                                    'an index definition for the column %s '
+                                    'on the model %s.%s as described here:\n'
                                     'http://www.allbuttonspressed.com/blog/django/2010/07/Managing-per-field-indexes-on-App-Engine'
-                                    % column)
+                                    % (column, self.query.model.__module__, self.query.model.__name__))
             if key in query:
                 existing_value = query[key]
                 if isinstance(existing_value, list):
     if end is not None:
         end = Cursor.from_websafe_string(end)
     queryset.query._gae_end_cursor = end
-    # Evaluate QuerySet
     return queryset

File settings_base.py

 DATABASES = {
     'default': {
         'ENGINE': 'djangoappengine.db',
+
+        # Other settings which you might want to override in your settings.py
+
+        # Activates high-replication support for remote_api
+        # 'HIGH_REPLICATION': True,
+
+        # Switch to the App Engine for Business domain
+        # 'DOMAIN': 'googleplex.com',
     },
 }