Changeset 3842
- Timestamp:
- 8 Jan 2009, 20:30:54 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPImport.py
r3841 r3842 67 67 self.schema_tool = getToolByName(waeup_tool, 'portal_schemas') 68 68 self.layout_tool = getToolByName(waeup_tool, 'portal_layouts') 69 self.types_tool = getToolByName(waeup_tool, 'portal_types') 69 70 self.portal_workflow = getToolByName(waeup_tool, 'portal_workflow') 70 71 self.portal_url = getToolByName(waeup_tool, 'portal_url') … … 870 871 msg = '' 871 872 export_file = "%s/export/students_removed.csv" % (i_home) 872 toexport = {873 873 874 'personal': ('firstname', 875 'middlename', 876 'lastname', 877 'perm_address', 878 ), 879 'clearance': ('lga', 880 'birthday', 881 ) 882 } 874 #toexport = { 875 # 876 # 'personal': ('firstname', 877 # 'middlename', 878 # 'lastname', 879 # 'perm_address', 880 # ), 881 # 'clearance': ('lga', 882 # 'birthday', 883 # ) 884 # 885 # } 886 887 sub_types = ['StudentApplication','StudentClearance','StudentPersonal'] 888 non_image_keys = {} 889 for i in sub_types: 890 pt_ob = getattr(self.types_tool,i) 891 sub_schemas = pt_ob.schemas 892 for i in sub_schemas: 893 if i.startswith('student_'): 894 schema = getattr(self.schema_tool,i) 895 field_id = i.replace('student_','') 896 non_image_keys[field_id] = [key for key in schema.keys() 897 if schema[key].meta_type != "CPS Image Field"] 898 toexport = non_image_keys 899 900 #import pdb;pdb.set_trace() 883 901 while True: 884 902 if hasattr(students_folder,student_id): … … 891 909 for f in toexport[k]: 892 910 fields.append(f) 893 if not os.path.exists(export_file):911 if True: #not os.path.exists(export_file): 894 912 #headline = ','.join(fields).replace('level','current_level') 895 913 headline = ','.join(fields)
Note: See TracChangeset for help on using the changeset viewer.