Changeset 2191 for WAeUP_SRP


Ignore:
Timestamp:
11 Sep 2007, 12:40:17 (17 years ago)
Author:
Henrik Bettermann
Message:

show correct sex:

this fix does actually not work because there is no attribute 'sex' for male students.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r2189 r2191  
    9797                if key == 'lga':
    9898                    v = self.portal_vocabularies.local_gov_areas.get(v)
     99                elif key == 'sex':
     100                    if v:
     101                        v = 'F'
     102                    else:
     103                        v = 'M'
    99104                d[key] = v
    100105            else:
    101106                d[key] = ''
    102107        return d
    103    
     108
    104109    def addRecord(self, **data): ###(
    105110        # The uid is the same as "bed".
     
    497502
    498503    def searchAndSetRecord(self, uid, student_id,prefix):
    499        
    500         # The following line must be activated after resetting the 
    501         # the portal_pins table. This is to avoid duplicate entries 
     504
     505        # The following line must be activated after resetting the
     506        # the portal_pins table. This is to avoid duplicate entries
    502507        # and disable duplicate payments.
    503        
     508
    504509        #student_id = student_id.upper()
    505510
     
    595600        WAeUPTable.__init__(self, name)
    596601
    597    
     602
    598603
    599604    security.declareProtected(ModifyPortalContent,"new_importCSV")###(
     
    640645            em = 'Error reading %s.csv' % filename
    641646            logger.error(em)
    642             return 
     647            return
    643648        d = self._import_new(csv_items,schema,layout,mode,logger)
    644649        imported = []
     
    672677                for k in outlist[0].keys():
    673678                    d[k] = k
    674                 outlist[0] = d 
     679                outlist[0] = d
    675680                outfile = open("file_name_%s" % itype,'w')
    676681                csv.DictWriter(outfile,outlist[0].keys()).writerows(outlist)
Note: See TracChangeset for help on using the changeset viewer.