Ignore:
Timestamp:
Mar 27, 2010, 3:34:11 PM (16 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, client
Children:
ee37f93
Parents:
dd2c3d9
git-author:
Alex Dehnert <adehnert@…> (03/27/10 15:34:11)
git-committer:
Alex Dehnert <adehnert@…> (03/27/10 15:34:11)
Message:

WIP: Add form for selecting parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • remit/finance_core/reporting.py

    rdd2c3d9 r8a0d18c  
    4646
    4747def get_primary_axis(slug, base_area, term, ):
    48     if slug in axes and axes[slug][1]:
    49         return axes[slug][0](base_area, term, )
     48    if slug in axes and axes[slug][2]:
     49        return (axes[slug][0], ) + axes[slug][1](base_area, term, )
    5050    else:
    5151        raise NotImplementedError
    5252
    5353def get_secondary_axis(slug, base_area, term, ):
    54     if slug in axes and axes[slug][2]:
    55         return axes[slug][0](base_area, term, )
     54    if slug in axes and axes[slug][3]:
     55        return (axes[slug][0], ) + axes[slug][1](base_area, term, )
    5656    else:
    5757        raise NotImplementedError
    5858
    5959def get_budget_areas(base_area, term, ):
    60     name = 'Budget Areas'
    6160    base_area_depth = base_area.depth
    6261    areas = base_area.get_descendants()
     
    7372    ]
    7473    axis_objs = areas
    75     return name, axis, axis_objs,
     74    return axis, axis_objs,
    7675
    7776def get_budget_terms(base_area, term, ):
    78     name = 'Budget Terms'
    7977    if term:
    8078        terms = finance_core.models.BudgetTerm.objects.filter(pk=term.pk)
     
    9088        for term in terms
    9189    ]
    92     return name, axis, terms
     90    return axis, terms
    9391
    9492def get_layers(base_area, term, ):
    95     name = 'Layers'
    9693    axis = [
    9794        (
     
    103100        for layer in finance_core.models.layers
    104101    ]
    105     return name, axis, None,
     102    return axis, None,
    106103
    107104axes = {
    108     'budget-areas': (get_budget_areas, True,  True,  ),
    109     'budget-terms': (get_budget_terms, True,  True,  ),
    110     'layers':       (get_layers,       False, True,  ),
     105    'budget-areas': ('Budget Areas',  get_budget_areas, True,  True,  ),
     106    'budget-terms': ('Budget Terms',  get_budget_terms, True,  True,  ),
     107    'layers':       ('Layers',        get_layers,       False, True,  ),
    111108}
    112109
Note: See TracChangeset for help on using the changeset viewer.