Esempio n. 1
0
    def add_to_report(self, report, key, dictionary):
        top_val = self.total_dateless_attribute_by_school(report, self.top_attrib)
        bottom_val = self.total_dateless_attribute_by_school(report, self.bottom_attrib)

        bottom_dict = {}
        reorganize_dictionary("bottom", bottom_val, bottom_dict, self.SCHOOL_ID, self.SCHOOL_NAME, "value_int__sum")
        val = []
        for rdict in top_val:
            if rdict[self.SCHOOL_ID] in bottom_dict:
                rdict["value_int__sum"] = float(rdict["value_int__sum"]) / bottom_dict[rdict[self.SCHOOL_ID]]["bottom"]
                val.append(rdict)

        reorganize_dictionary(key, val, dictionary, self.SCHOOL_ID, self.SCHOOL_NAME, "value_int__sum")
Esempio n. 2
0
 def add_to_report(self, report, key, dictionary):
     val = self.total_attribute_by_school(report, self.keyword)
     num_weeks = self.num_weeks(report)
     for rdict in val:
         rdict["value_int__sum"] /= num_weeks
     reorganize_dictionary(key, val, dictionary, self.SCHOOL_ID, self.SCHOOL_NAME, "value_int__sum")
Esempio n. 3
0
 def add_to_report(self, report, key, dictionary):
     val = self.total_attribute_by_school(report, self.keyword)
     reorganize_dictionary(key, val, dictionary, self.SCHOOL_ID, self.SCHOOL_NAME, "value_int__sum")