Changeset 3990


Ignore:
Timestamp:
28 Feb 2009, 11:49:23 (16 years ago)
Author:
Henrik Bettermann
Message:

export field names must be unique but, unfortunately, firstname, middlename and lastname are not, thus we have to omit them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/WAeUPImport.py

    r3988 r3990  
    941941                    field_id = i.replace('student_','')
    942942                    non_image_keys[field_id] = [key for key in schema.keys()
    943                                      if schema[key].meta_type != "CPS Image Field"]       
     943                                                if schema[key].meta_type != "CPS Image Field"]
     944       
     945        # export field names must be unique but, unfortunately, firstname, middlename and lastname are not
     946        # thus we have to omit them
     947        non_image_keys['clearance'].remove('firstname')
     948        non_image_keys['clearance'].remove('middlename')
     949        non_image_keys['clearance'].remove('lastname')
    944950        toexport = non_image_keys
    945951
    946         #import pdb;pdb.set_trace()   
    947952        while True:
    948953            if hasattr(students_folder,student_id):
     
    961966                    for f in toexport_for_reimport[k]:
    962967                        fields_for_reimport.append(f)                       
    963                 if True:    #not os.path.exists(export_file):       
     968                if not os.path.exists(export_file):       
    964969                    headline = ','.join(fields)
    965970                    open(export_file,"a").write(headline +'\n')
     971                if not os.path.exists(reimport_file): 
    966972                    headline_for_reimport = ','.join(fields_for_reimport)                   
    967973                    open(reimport_file,"a").write(headline_for_reimport +'\n')                   
     
    990996                open(reimport_file,"a").write('\n'.join(line_for_reimport) +'\n')               
    991997                self.course_results.exportRemoveAllCourses(student_id = student_id, export = True, remove = True)
    992 #                self.course_results.exportRemoveAllCourses(student_id = student_id, export = True, remove = False)
    993998                self.payments_catalog.exportRemoveAllPayments(student_id = student_id, export = True, remove = True)
    994 #                self.payments_catalog.exportRemoveAllPayments(student_id = student_id, export = True, remove = False)
    995999                self.waeup_tool.exportAllStudyLevels(student_id = student_id)
    9961000                # end export
Note: See TracChangeset for help on using the changeset viewer.