def get_initial_resources(): resources = [] for project in core.get_projects(): for repository in core.get_repositories(project): resource = {} resource.update(core.get_branches(project, repository)) resource.update(core.get_tags(project, repository)) resources.append(resource) return resources
def branches(project, repository): offset = request.args.get('offset', 0, type=int) limit = request.args.get('limit', 100, type=int) return jsonify(core.get_branches(project, repository, offset, limit))