Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9605)

Unified Diff: chrome/common/extensions/docs/server2/datastore_models.py

Issue 14218004: Devserver: only populate data during cron jobs, meaning all data from instances (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integration test Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/datastore_models.py
diff --git a/chrome/common/extensions/docs/server2/datastore_models.py b/chrome/common/extensions/docs/server2/datastore_models.py
new file mode 100644
index 0000000000000000000000000000000000000000..c9bbe0d503f2f847169d4a8e0c0eeeec9a5f6a5c
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/datastore_models.py
@@ -0,0 +1,24 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from appengine_wrappers import db
+import cPickle
+
+# A collection of the data store models used throughout the server.
+# These values are global within datastore.
+
+class PersistentObjectStoreItem(db.Model):
+ pickled_value = db.BlobProperty()
+
+ @classmethod
+ def CreateKey(cls, namespace, key):
+ return db.Key.from_path(cls.__name__, '%s/%s' % (namespace, key))
+
+ @classmethod
+ def CreateItem(cls, namespace, key, value):
+ return PersistentObjectStoreItem(key=cls.CreateKey(namespace, key),
+ pickled_value=cPickle.dumps(value))
+
+ def GetValue(self):
+ return cPickle.loads(self.pickled_value)
« no previous file with comments | « chrome/common/extensions/docs/server2/compiled_file_system.py ('k') | chrome/common/extensions/docs/server2/file_system.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698