Index: /WAeUP_SRP/trunk/WAeUPImport.py
===================================================================
--- /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3841)
+++ /WAeUP_SRP/trunk/WAeUPImport.py	(revision 3842)
@@ -67,4 +67,5 @@
         self.schema_tool = getToolByName(waeup_tool, 'portal_schemas')
         self.layout_tool = getToolByName(waeup_tool, 'portal_layouts')
+        self.types_tool = getToolByName(waeup_tool, 'portal_types')
         self.portal_workflow = getToolByName(waeup_tool, 'portal_workflow')
         self.portal_url = getToolByName(waeup_tool, 'portal_url')
@@ -870,15 +871,32 @@
         msg = ''
         export_file = "%s/export/students_removed.csv" % (i_home)
-        toexport = {
         
-                    'personal': ('firstname',
-                                 'middlename',
-                                 'lastname',
-                                 'perm_address',
-                                 ),
-                    'clearance': ('lga',
-                                  'birthday',
-                                 )
-                    }
+        #toexport = {
+        #
+        #            'personal': ('firstname',
+        #                         'middlename',
+        #                         'lastname',
+        #                         'perm_address',
+        #                         ),
+        #            'clearance': ('lga',
+        #                          'birthday',
+        #                         )
+        #
+        #           }
+
+        sub_types = ['StudentApplication','StudentClearance','StudentPersonal']
+        non_image_keys = {}
+        for i in sub_types:
+            pt_ob = getattr(self.types_tool,i)
+            sub_schemas = pt_ob.schemas
+            for i in sub_schemas:
+                if i.startswith('student_'):
+                    schema = getattr(self.schema_tool,i)
+                    field_id = i.replace('student_','')
+                    non_image_keys[field_id] = [key for key in schema.keys()
+                                     if schema[key].meta_type != "CPS Image Field"]        
+        toexport = non_image_keys
+
+        #import pdb;pdb.set_trace()   
         while True:
             if hasattr(students_folder,student_id):
@@ -891,5 +909,5 @@
                     for f in toexport[k]:
                         fields.append(f)
-                if not os.path.exists(export_file):        
+                if True:    #not os.path.exists(export_file):        
                     #headline = ','.join(fields).replace('level','current_level')
                     headline = ','.join(fields)
