Changeset 5583


Ignore:
Timestamp:
10 Nov 2010, 08:57:15 (14 years ago)
Author:
Henrik Bettermann
Message:

Extend Moodle data export file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPTables.py

    r5581 r5583  
    775775            return       
    776776        fields = [field for field in self.schema()]
    777         export_fields = ['username','firstname','lastname','email','current_session','reg_state','password']
     777        export_fields = ['username','firstname','lastname','email','currentsession','regstate','password','city','country','deleted']
    778778        format = ','.join(['"%%(%s)s"' % fn for fn in export_fields])
    779779        csv = []
     
    787787            if len(records) == 0:
    788788                raise KeyError("No record for uid %s" % uid)
    789             rec = self.record2dict(fields,records[0],None)           
    790             rec['firstname'] = rec['firstname'] + rec['middlename']
    791             rec.update({'reg_state':rec['review_state']})
    792             rec['current_session'] = rec['session']
     789            rec = self.record2dict(fields,records[0],None)   
     790            fn = rec['firstname'].replace(',',' ') 
     791            mn = rec['middlename'].replace(',',' ')
     792            ln = rec['lastname'].replace(',',' ')
     793            rec['firstname'] = fn + ' ' + mn
     794            rec['lastname'] = ln
     795            rec['regstate'] = rec['review_state']
     796            rec['currentsession'] = rec['session']
    793797            rec['username'] = rec['id']
     798            rec['city'] = ''
     799            rec['country'] = 'ng'
     800            rec['deleted'] = '0'
    794801            rec['password'] = self.waeup_tool.getCredential(rec['id'])
    795802            csv.append(format % rec)
Note: See TracChangeset for help on using the changeset viewer.