Trees | Indices | Help |
---|
|
1 # coding: utf-8 2 3 from flask import url_for 4 from flask_restful import Resource 5 6 from ...logic.coprs_logic import MockChrootsLogic 7 8 from ..schemas import MockChrootSchema 9 from ..util import get_one_safe, get_request_parser, arg_bool13 return { 14 "chroot": MockChrootSchema().dump(chroot)[0], 15 "_links": { 16 "self": {"href": url_for(".mockchrootr", name=chroot.name)}, 17 }, 18 }1922 23 @classmethod46 5325 parser = get_request_parser() 26 parser.add_argument('active_only', type=arg_bool) 27 req_args = parser.parse_args() 28 active_only = False 29 if req_args["active_only"]: 30 active_only = True 31 32 chroots = MockChrootsLogic.get_multiple(active_only=active_only).all() 33 34 self_extra = {} 35 if active_only: 36 self_extra["active_only"] = active_only 37 return { 38 "_links": { 39 "self": {"href": url_for(".mockchrootlistr", **self_extra)}, 40 }, 41 "chroots": [ 42 render_mock_chroot(chroot) 43 for chroot in chroots 44 ] 45 }
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Dec 5 22:37:24 2016 | http://epydoc.sourceforge.net |