Changeset 064683a
- Timestamp:
- Jan 27, 2010, 1:00:36 PM (15 years ago)
- Branches:
- master, client
- Children:
- 17193ee
- Parents:
- 5abe506
- git-author:
- Alex Dehnert <adehnert@…> (01/27/10 13:00:36)
- git-committer:
- Alex Dehnert <adehnert@…> (01/27/10 13:00:36)
- Location:
- treasury
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
treasury/finance_core/models.py
r52c3467 r064683a 1 from django.db import models 1 from django.db import models, connection 2 2 import settings 3 3 import treebeard.mp_tree … … 9 9 name = models.CharField(max_length=50) 10 10 comment = models.TextField(blank=True) 11 12 # Applicable to every term? 11 13 always = models.BooleanField(blank=True, default=False) 12 14 … … 16 18 interested = models.EmailField(help_text='Email address of parties interested in the area', blank=True) # interested parties (ie, whole committee) 17 19 use_owner = models.BooleanField(default=False, blank=True) 20 account_number = models.IntegerField(help_text='Account number: for example, cost object or GL', blank=True, null=True) 18 21 19 22 def contact_address(self,): … … 24 27 address = self.interested or self.owner 25 28 return address or self.get_parent().contact_address() 29 30 def get_account_number(self): 31 """Retrieve the account number for this account. 32 33 This properly recurses through the hierarchy until reaching the root 34 or an account with the account number set.""" 35 36 print self.account_number 37 if self.account_number: 38 return self.account_number 39 else: 40 parent = self.get_parent() 41 if parent: 42 return parent.get_account_number() 43 else: 44 return 0 26 45 27 46 def mark_used(self, term, comment=""): -
treasury/vouchers/import_budget.py
r5abe506 r064683a 49 49 always=True, use_owner=True, 50 50 owner='ua-treasurer@mit.edu', 51 interested='ua-treasurer@mit.edu', ) 51 interested='ua-treasurer@mit.edu', 52 account_number=0, 53 ) 52 54 # This is sorta evil, in that it abuses the fact that Python 53 55 # won't put name out of scope … … 73 75 interested=coerce_full_email(comm['email_list']), 74 76 use_owner=comm['prefer_chair'], 77 account_number=(comm['account'] or 0), 75 78 always=True, 76 79 )
Note: See TracChangeset
for help on using the changeset viewer.