Created
August 7, 2016 16:54
-
-
Save 526avijitgupta/2d84daf3c15e4c62c578b88279caf479 to your computer and use it in GitHub Desktop.
Fetch latest updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── | |
modified: core/storage/base_model/gae_models.py | |
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── | |
@ gae_models.py:411 @ class VersionedModel(BaseModel): | |
@classmethod | |
def get_snapshots_metadata( | |
cls, model_instance_id, version_numbers, allow_deleted=False): | |
cls, model_instance_id, user_ids, version_numbers, allow_deleted=False): | |
"""Returns a list of dicts, each representing a model snapshot. | |
One dict is returned for each version number in the list of version | |
@ gae_models.py:429 @ class VersionedModel(BaseModel): | |
cls._get_snapshot_id(model_instance_id, version_number) | |
for version_number in version_numbers] | |
# pylint: enable=protected-access | |
metadata_keys = [ | |
ndb.Key(cls.SNAPSHOT_METADATA_CLASS, snapshot_id) | |
for snapshot_id in snapshot_ids] | |
metadata_keys = cls.SNAPSHOT_METADATA_CLASS.query().filter( | |
cls.SNAPSHOT_METADATA_CLASS.committer_id.IN(user_ids) | |
) | |
# metadata_keys = [ | |
# ndb.Key(cls.SNAPSHOT_METADATA_CLASS, snapshot_id) | |
# for snapshot_id in snapshot_ids] | |
returned_models = ndb.get_multi(metadata_keys) | |
for ind, model in enumerate(returned_models): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment