Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 526avijitgupta/2d84daf3c15e4c62c578b88279caf479 to your computer and use it in GitHub Desktop.
Save 526avijitgupta/2d84daf3c15e4c62c578b88279caf479 to your computer and use it in GitHub Desktop.
Fetch latest updates
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
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