Exemple #1
0
    def _get_descriptors(self):
        """ Get a list of (code, description) descriptors
        """

        descriptors = get_all_descriptors()

        debug_descriptors = ('D1.1', 'D4', 'D5', 'D6')

        if self.debug:
            descriptors = [x for x in descriptors if x[0] in debug_descriptors]

        return descriptors
Exemple #2
0
    def descriptors(self):
        descriptors = get_all_descriptors()
        descriptors.pop(0)  # remove D1 general descriptor

        res = []

        for desc in descriptors:
            desc_obj = get_descriptor(desc[0])

            res.append((desc_obj.template_vars['title'], desc_obj.title))

        return res
Exemple #3
0
    def setup_data(self):
        data = []
        descriptors = get_all_descriptors()

        for desc_code, desc_title in descriptors:
            conclusions = []
            for art_id, art_title in self.articles:
                concl = ''
                assess_data = self.get_assessment_data(self.region_code,
                                                       art_id, desc_code)

                if assess_data:
                    concl = assess_data.conclusion

                conclusions.append(concl)

            if any(conclusions):
                data.append((desc_title, conclusions))

        return data
Exemple #4
0
    def _art_4_ids(self, descriptor, **kwargs):
        """ Return all descriptors """

        descriptors = get_all_descriptors()
        res = []

        for descriptor in descriptors:
            descr_id = descriptor[0]
            if descr_id == 'D1':
                continue

            descr_title = descriptor[1]
            descriptor_obj = get_descriptor(descr_id)
            alternate_id = descriptor_obj.template_vars['title']

            descr_opt = DescriptorOption(id=alternate_id,
                                         title=descr_title,
                                         is_primary=lambda _: True)

            res.append(descr_opt)

        return res
Exemple #5
0
    def get_descriptors(self):
        """Exclude first item, D1 """
        descriptors = get_all_descriptors()

        return descriptors[1:]
Exemple #6
0
    def get_descriptors(self):
        descriptors = get_all_descriptors()

        return descriptors