diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-22 00:08:24 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-22 00:08:24 +0200 |
| commit | 4ccbb4bef309571159c9558cca5da04987a68646 (patch) | |
| tree | 3bedb956e0505accf622a6c42c94f3e613286bd6 /archaeological_operations/models.py | |
| parent | 39e0c9cf302f8b468e116047eef18f42d712166e (diff) | |
| download | Ishtar-4ccbb4bef309571159c9558cca5da04987a68646.tar.bz2 Ishtar-4ccbb4bef309571159c9558cca5da04987a68646.zip | |
Djangoization - Major refactoring (step 15)
* works on dashboards
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 831190342..082a0072d 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -645,6 +645,8 @@ class OperationDashboard: cost_means, cost_sums = [], [] for idx, year in enumerate(years): vals = [r_years[idx] for lbl, r_years in dct_res[res_key]] + if not vals: + continue sum_area = sum([a for a, c in vals]) sum_cost = sum([c for a, c in vals]) area_means.append(sum_area/len(vals)) |
