- Timestamp:
- 17 Dec 2008, 22:19:08 (16 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPImport.py
r3820 r3822 70 70 self.portal_url = getToolByName(waeup_tool, 'portal_url') 71 71 self.portal_catalog = waeup_tool.portal_catalog 72 self.portal_directories = waeup_tool.portal_directories 72 73 self.students_catalog = waeup_tool.students_catalog 73 74 self.courses_catalog = waeup_tool.courses_catalog … … 844 845 ###) 845 846 847 def remove(self,mapping): ###( 848 "remove student records due import" 849 logger = logging.getLogger('WAeUPImport.StudentImport.remove') 850 students_folder = self.portal_url.getPortalObject().campus.students 851 stdir = self.portal_directories.students 852 student_id = mapping.get('id',None) 853 msg = '' 854 export_file = "%s/export/students_removed.csv" % (i_home) 855 toexport = { 856 857 'personal': ('firstname', 858 'middlename', 859 'lastname', 860 'perm_address', 861 ), 862 'clearance': ('lga', 863 'birthday', 864 ) 865 } 866 while True: 867 if hasattr(students_folder,student_id): 868 # begin export 869 line = [] 870 fields = [] 871 for f in self.students_catalog.schema(): 872 fields.append(f) 873 for k in toexport.keys(): 874 for f in toexport[k]: 875 fields.append(f) 876 if not os.path.exists(export_file): 877 #headline = ','.join(fields).replace('level','current_level') 878 headline = ','.join(fields) 879 open(export_file,"a").write(headline +'\n') 880 format = '"%(' + ')s","%('.join(fields) + ')s"' 881 res = self.students_catalog(id = student_id) 882 student = res[0] 883 student_obj = getattr(students_folder,student_id) 884 d = student.getFormattedStudentEntry(student) 885 for k in toexport.keys()[0:]: 886 try: 887 object = getattr(student_obj,k) 888 object_doc = object.getContent() 889 except: 890 continue 891 for f in toexport[k]: 892 d[f] = getattr(object_doc,f,'') 893 line.append(format % d) 894 open(export_file,"a").write('\n'.join(line) +'\n') 895 # end export 896 students_folder.manage_delObjects((student_id),) 897 else: 898 msg = "Student object not found" 899 break 900 if hasattr(stdir, student_id): 901 stdir.deleteEntry(student_id) 902 self.waeup_tool.removePictureFolder(student_id) 903 break 904 return student_id,msg,mapping 905 906 846 907 def edit(self,mapping): ###( 847 908 "edit student records due import" -
WAeUP_SRP/trunk/profiles/ois/vocabularies/levels.xml
r3698 r3822 13 13 <item key="500" msgid="">Year 11</item> 14 14 <item key="600" msgid="">Year 12</item> 15 <item key="700" msgid="">Year 13</item> 15 16 </object>
Note: See TracChangeset for help on using the changeset viewer.