Changeset dd2c3d9 for remit/finance_core/reporting.py
- Timestamp:
- Mar 27, 2010, 2:47:54 PM (15 years ago)
- Branches:
- master, client
- Children:
- 8a0d18c
- Parents:
- ca03565
- git-author:
- Alex Dehnert <adehnert@…> (03/27/10 14:47:54)
- git-committer:
- Alex Dehnert <adehnert@…> (03/27/10 14:47:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
remit/finance_core/reporting.py
rca03565 rdd2c3d9 45 45 46 46 47 def get_primary_axis(slug, base_area ):47 def get_primary_axis(slug, base_area, term, ): 48 48 if slug in axes and axes[slug][1]: 49 return axes[slug][0](base_area )49 return axes[slug][0](base_area, term, ) 50 50 else: 51 51 raise NotImplementedError 52 52 53 def get_secondary_axis(slug, base_area ):53 def get_secondary_axis(slug, base_area, term, ): 54 54 if slug in axes and axes[slug][2]: 55 return axes[slug][0](base_area )55 return axes[slug][0](base_area, term, ) 56 56 else: 57 57 raise NotImplementedError 58 58 59 def get_budget_areas(base_area ):59 def get_budget_areas(base_area, term, ): 60 60 name = 'Budget Areas' 61 61 base_area_depth = base_area.depth 62 areas = base_area.get_descendants() 63 if term: 64 areas = areas.filter(Q(always=True) or Q(budget_term=term)) 62 65 axis = [ 63 66 ( … … 67 70 Q(lineitem__budget_area=area), 68 71 ) 69 for area in base_area.get_descendants()72 for area in areas 70 73 ] 71 axis_objs = base_area.get_descendants()74 axis_objs = areas 72 75 return name, axis, axis_objs, 73 76 74 def get_budget_terms(base_area ):77 def get_budget_terms(base_area, term, ): 75 78 name = 'Budget Terms' 76 terms = finance_core.models.BudgetTerm.objects.all() 79 if term: 80 terms = finance_core.models.BudgetTerm.objects.filter(pk=term.pk) 81 else: 82 terms = finance_core.models.BudgetTerm.objects.all() 77 83 axis = [ 78 84 ( … … 86 92 return name, axis, terms 87 93 88 def get_layers(base_area ):94 def get_layers(base_area, term, ): 89 95 name = 'Layers' 90 96 axis = [
Note: See TracChangeset
for help on using the changeset viewer.