Changeset 82afa57
- Timestamp:
- Feb 2, 2010, 2:07:38 AM (16 years ago)
- 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)
- File:
-
- 1 edited
-
treasury/vouchers/import_budget.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
treasury/vouchers/import_budget.py
r064683a r82afa57 5 5 import vouchers.models 6 6 import finance_core.models 7 from django.db import connection8 7 from finance_core.models import BudgetArea 9 8 from finance_core.models import coerce_full_email … … 25 24 return committees 26 25 27 def do_populate_area_structure( ):26 def do_populate_area_structure(default_addr): 28 27 nodes = [ 29 28 [ ('Accounts', 'Root',) ], … … 48 47 BudgetArea.add_root(name=name, comment=comment, 49 48 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, 52 51 account_number=0, 53 52 ) … … 57 56 return (depth, ) 58 57 59 def do_populate_committees( committees):60 (depth,) = do_populate_area_structure( )58 def do_populate_committees(default_addr, committees): 59 (depth,) = do_populate_area_structure(default_addr, ) 61 60 core = BudgetArea.objects.get(name='Core', depth=depth) 62 61 comms = BudgetArea.objects.get(name='Committees', depth=depth) … … 123 122 124 123 125 def main( committees_file, budget_file, term_name, ):124 def main(default_addr, committees_file, budget_file, term_name, ): 126 125 term = vouchers.models.BudgetTerm.objects.get(name=term_name) 127 126 committees = build_committees(committees_file,) 128 (depth, ) = do_populate_committees( committees)127 (depth, ) = do_populate_committees(default_addr, committees) 129 128 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.queries138 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.
![(please configure the [header_logo] section in trac.ini)](/trac/chrome/site/your_project_logo.png)