author David Douard <>
Tue, 21 Oct 2014 23:17:46 +0200
changeset 1738 dbf8a63bd907
parent 1419 04b8e8af2e66
child 1594 c4f84b3b101e
permissions -rw-r--r--
[recipe] improve recipes' comments

# copyright 2010-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact --
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 2.1 of the License, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
# You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <>.

__docformat__ = "restructuredtext en"
_ = unicode

from cubicweb.web.views import json
from cubicweb.predicates import is_instance, match_form_params

class GetDependencies(json.JsonEntityView):
    __regid__ = 'apycot.get_dependencies'
    __select__ = is_instance('TestExecution')

    def call(self):
        data = []
        for entity in self.cw_rset.entities():
            tconfig = entity.configuration
            env = entity.environment
            data.append(tconfig.dependencies(env) + [env])

class GetConfiguration(json.JsonEntityView):
    __regid__ = 'apycot.get_configuration'
    __select__ = is_instance('TestConfig') & match_form_params('environment')

    def call(self):
        data = []
        env = self._cw.entity_from_eid(self._cw.form['environment'])
        for tconfig in self.cw_rset.entities():