Changeset 82afa57


Ignore:
Timestamp:
Feb 2, 2010, 2:07:38 AM (16 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, client
Children:
07daa76
Parents:
1732748
git-author:
Alex Dehnert <adehnert@…> (02/02/10 02:07:38)
git-committer:
Alex Dehnert <adehnert@…> (02/02/10 02:07:38)
Message:

Purge UA from import_budget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • treasury/vouchers/import_budget.py

    r064683a r82afa57  
    55import vouchers.models
    66import finance_core.models
    7 from django.db import connection
    87from finance_core.models import BudgetArea
    98from finance_core.models import coerce_full_email
     
    2524    return committees
    2625
    27 def do_populate_area_structure():
     26def do_populate_area_structure(default_addr):
    2827    nodes = [
    2928        [ ('Accounts', 'Root',) ],
     
    4847                    BudgetArea.add_root(name=name, comment=comment,
    4948                        always=True, use_owner=True,
    50                         owner='ua-treasurer@mit.edu',
    51                         interested='ua-treasurer@mit.edu',
     49                        owner=default_addr,
     50                        interested=default_addr,
    5251                        account_number=0,
    5352                    )
     
    5756    return (depth, )
    5857
    59 def do_populate_committees(committees):
    60     (depth,) = do_populate_area_structure()
     58def do_populate_committees(default_addr, committees):
     59    (depth,) = do_populate_area_structure(default_addr, )
    6160    core = BudgetArea.objects.get(name='Core', depth=depth)
    6261    comms = BudgetArea.objects.get(name='Committees', depth=depth)
     
    123122
    124123
    125 def main(committees_file, budget_file, term_name, ):
     124def main(default_addr, committees_file, budget_file, term_name, ):
    126125    term = vouchers.models.BudgetTerm.objects.get(name=term_name)
    127126    committees = build_committees(committees_file,)
    128     (depth, ) = do_populate_committees(committees)
     127    (depth, ) = do_populate_committees(default_addr, committees)
    129128    do_process_rows(committees, budget_file, term, depth)
    130 
    131 
    132 def spring_2010():
    133     committee_file = open('/mit/ua/officers/treasurer/resources/software/committees.csv')
    134     budget_file = open('/mit/ua/officers/treasurer/budgeting/FY10/private/spring-working.csv')
    135     term_name = 'Spring 2010'
    136     main(committee_file, budget_file, term_name, )
    137     print connection.queries
    138 
    139 
    140 if __name__== '__main__':
    141     #print "Syntax: %s committee_file format_file budget_file budget_term [override_address]" % (sys.argv[0], )
    142     spring_2010()
Note: See TracChangeset for help on using the changeset viewer.