def all(cls, organization=None, media_type=None, search=None, username=None, **kwargs): return [ dict(x._asdict()) for x in model.list_applications( namespace=organization, media_type=media_type, search=search, username=username ) ]
def dump_all(cls, package_class=None): result = [] for repo in appr_app_model.list_applications(with_channels=True): for chan in repo.channels: result.append({ 'name': chan.name, 'current': chan.current, 'package': repo.name }) return result
def dump_all(cls, blob_cls): result = [] for repo in appr_app_model.list_applications(with_channels=True): package_name = repo.name for release in repo.releases: for mtype in cls.manifests(package_name, release): package = appr_app_model.fetch_release( package_name, release, mtype) blob = blob_cls.get(package_name, package.manifest.content.digest) app_data = cls._apptuple_to_dict(package) app_data.pop('digest') app_data['channels'] = [ x.name for x in appr_app_model.list_release_channels( package_name, package.release, False) ] app_data['blob'] = blob.b64blob result.append(app_data) return result