Chromium Code Reviews| Index: appengine/machine_provider/models.py |
| diff --git a/appengine/machine_provider/models.py b/appengine/machine_provider/models.py |
| index d2c95e54c2ee17064a67e537a61d3c666342792d..e0d8339e07481fe1e4fdac62265ef1aa9644a23f 100644 |
| --- a/appengine/machine_provider/models.py |
| +++ b/appengine/machine_provider/models.py |
| @@ -39,6 +39,8 @@ class LeaseRequest(ndb.Model): |
| # Checksum of the rpc_messages.LeaseRequest instance. Used to compare incoming |
| # LeaseRequets for deduplication. |
| deduplication_checksum = ndb.StringProperty(required=True, indexed=False) |
| + # DateTime indicating the last modification time. |
| + last_modified_ts = ndb.DateTimeProperty(auto_now=True) |
|
M-A Ruel
2016/07/30 01:41:58
FYI only. auto_now is impossible to work around wh
smut
2016/08/02 23:26:33
Acknowledged.
|
| # ID of the CatalogMachineEntry provided for this lease. |
| machine_id = ndb.StringProperty() |
| # auth.model.Identity of the issuer of the original request. |
| @@ -103,6 +105,8 @@ class CatalogEntry(ndb.Model): |
| field.name for field in rpc_messages.Dimensions.all_fields() |
| ], |
| ) |
| + # DateTime indicating the last modified time. |
| + last_modified_ts = ndb.DateTimeProperty(auto_now=True) |
| class CatalogCapacityEntry(CatalogEntry): |
| @@ -190,6 +194,9 @@ class CatalogMachineEntry(CatalogEntry): |
| pubsub_topic = ndb.StringProperty(indexed=False) |
| # Project the Cloud Pub/Sub topic exists in. |
| pubsub_topic_project = ndb.StringProperty(indexed=False) |
| + # Determines sorted order relative to other CatalogMachineEntries. |
| + sort_ordering = ndb.ComputedProperty(lambda self: '%s:%s' % ( |
| + self.dimensions.backend, self.dimensions.hostname)) |
| # Element of CatalogMachineEntryStates giving the state of this entry. |
| state = ndb.StringProperty( |
| choices=CatalogMachineEntryStates, |