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

Side by Side Diff: appengine/findit/gae_libs/model/versioned_model.py

Issue 2488113005: [Findit] Re-org code. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides a model to support versioned entities in datastore. 5 """Provides a model to support versioned entities in datastore.
6 6
7 Idea: use a root model entity to keep track of the most recent version of a 7 Idea: use a root model entity to keep track of the most recent version of a
8 versioned entity, and make the versioned entities and the root model entity in 8 versioned entity, and make the versioned entities and the root model entity in
9 the same entity group so that they could be read and written in a transaction. 9 the same entity group so that they could be read and written in a transaction.
10 """ 10 """
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 @classmethod 156 @classmethod
157 def _get_kind(cls): 157 def _get_kind(cls):
158 return root_model_name 158 return root_model_name
159 159
160 return _RootModel 160 return _RootModel
161 161
162 @classmethod 162 @classmethod
163 def _GetRootKey(cls, key=None): 163 def _GetRootKey(cls, key=None):
164 return ndb.Key(cls._GetRootModel(), key if key is not None else 1) 164 return ndb.Key(cls._GetRootModel(), key if key is not None else 1)
OLDNEW
« no previous file with comments | « appengine/findit/gae_libs/model/versioned_config.py ('k') | appengine/findit/infra_api_clients/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698