예제 #1
0
    def to_dict(self):

        out = Params()
        out.add(self.data, 'configurations')
        for line_data in self.lines:
            out.add(line_data, 'lines')

        return out.data
예제 #2
0
    def parms_to_dict(self):

        params = Params({})
        params.add(self.jsonify(), 'configurations')

        if self.device.device_type.name=='rc':
            for line in self.get_lines():
                params.add(line.jsonify(), 'lines')

        return params.data
예제 #3
0
    def parms_to_dict(self):

        params = Params({})
        params.add(self.jsonify(), 'campaigns')

        for exp in Experiment.objects.filter(campaign = self):
            params.add(exp.jsonify(), 'experiments')
            configurations = Configuration.objects.filter(experiment=exp, type=0)

            for conf in configurations:
                params.add(conf.jsonify(), 'configurations')
                if conf.device.device_type.name=='rc':
                    for line in conf.get_lines():
                        params.add(line.jsonify(), 'lines')

        return params.data