Changeset 2125
- Timestamp:
- 19 Aug 2007, 15:10:14 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Students.py
r2124 r2125 16 16 from Products.CPSCore.CPSMembershipTool import CPSUnrestrictedUser 17 17 from Products.WAeUP_SRP.Academics import makeCertificateCode 18 18 19 from Products.AdvancedQuery import Eq, Between, Le,In 19 20 import DateTime … … 97 98 ###) 98 99 99 def formatLGA(lga): 100 if lga.find('_') > -1: 101 lgadic = lga.split('_') 102 return lgadic[0].upper(),lgadic[1].upper() 103 if lga.find('/') > -1: 104 lgadic = lga.split('/') 105 return lgadic[0].upper(),lgadic[1].upper() 106 return "",lga 100 def formatLGA(lga,voc=None): 101 if voc is not None: 102 if voc.has_key(lga): 103 state,lga = voc[lga].split(' / ') 104 elif lga.find(' / ') > -1: 105 state,lga = lga.split(' / ') 106 else: 107 state,lga = "",lga 108 return state.upper(),lga.upper() 107 109 108 110 class StudentsFolder(CPSDocument): ###( … … 999 1001 continue 1000 1002 if with_lga: 1001 d['state'],d['lga'] = formatLGA(d['lga'] )1003 d['state'],d['lga'] = formatLGA(d['lga'],voc = self.portal_vocabularies.local_gov_areas) 1002 1004 lines.append(format % d) 1003 1005 total += 1 … … 1061 1063 not_all = False 1062 1064 d = self.getFormattedStudentEntry(student) 1063 d['state'],d['lga'] = formatLGA(d['lga'] )1065 d['state'],d['lga'] = formatLGA(d['lga'],voc = self.portal_vocabularies.local_gov_areas) 1064 1066 lines.append(format % d) 1065 1067 total += 1
Note: See TracChangeset for help on using the changeset viewer.