Index: WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTool.py	(revision 1773)
+++ WAeUP_SRP/trunk/WAeUPTool.py	(revision 1774)
@@ -755,6 +755,62 @@
     ###)
 
+    security.declareProtected(ModifyPortalContent,'importEditStudent') ###(
+    def importEditStudent(self,dict):
+        "edit a students data"
+        logger = logging.getLogger('WAeUPTool.create_student')
+        students_folder = self.portal_url.getPortalObject().campus.students
+        sid = dict.get('id',None)
+        jamb_reg_no = dict.get('jamb_reg_no',None)
+        matric_no = dict.get('matric_no',None)
+        if sid:
+            res = self.students_catalog(id = sid)
+            if not res:
+                return '',"no student with id %s" % sid
+            elif matric_no and res[0].matric_no and\
+              matric_no != res[0].matric_no:
+                return '%s' % res[0].id ,"student has no matric_no %s" % matric_no
+            elif jamb_reg_no and res[0].jamb_reg_no and\
+              jamb_reg_no != res[0].jamb_reg_no:
+                return '%s' % res[0].id ,"student has no jamb_reg_no %s" % jamb_reg_no
+        elif matric_no:
+            res = self.students_catalog(matric_no = matric_no)
+            if not res:
+                return '',"no student with matric_no %s" % matric_no
+            elif jamb_reg_no and res[0].jamb_reg_no and\
+              jamb_reg_no != res[0].jamb_reg_no:
+                return '%s' % res[0].id ,"student has no jamb_reg_no %s" % jamb_reg_no
+        elif jamb_reg_no:
+            res = self.students_catalog(jamb_reg_no = jamb_reg_no)
+            if not res:
+                return '',"no student with jamb_reg_no %s" % jamb_reg_no
+        sid = res[0].id
+        student_obj = getattr(students_folder,sid)
+        f2t = self.student_field2types
+        d = {}
+        d['jamb_sex']  = 'M'
+        if dict.get('sex'):
+            d['jamb_sex']  = 'F'
+        for pt in f2t.keys():
+            sub_obj = getattr(student_obj,f2t[pt]['id'],None)
+            if sub_obj is None:
+                student_obj.invokeFactory(pt,f2t[pt]['id'])
+                sub_obj = getattr(student_obj,f2t[pt]['id'])
+            sub_doc = sub_obj.getContent()
+            self.portal_workflow.doActionFor(sub_obj,'open',dest_container=sub_obj)
+            d['Title'] = f2t[pt]['title']
+            for field in f2t[pt]['fields']:
+                d[field] = dict.get(field,'')
+            sub_doc.edit(mapping = d)
+            # new_state = f2t[pt]['wf_state']
+            # if new_state != "remain":
+            #     self.portal_workflow.doActionFor(sub_obj,new_state,dest_container=sub_obj)
+        # wfaction = 'return'
+        # self.portal_workflow.doActionFor(student_obj,wfaction)
+        # student_obj.manage_setLocalRoles(sid, ['Owner',])
+        return sid,''
+    ###)
+
     security.declareProtected(ModifyPortalContent,"importData")###(
-    def importData(self,filename,name):
+    def importData(self,filename,name,edit=False):
         """load data from CSV values"""
         import transaction
@@ -788,5 +844,8 @@
         for widget in layout.keys():
             validators[widget] = layout[widget].validate
-        importer_name = "import%s" % name.capitalize()
+        if edit:
+            importer_name = "importEdit%s" % name.capitalize()
+        else:
+            importer_name = "import%s" % name.capitalize()
         importer = getattr(self, '%s' % importer_name,None)
         if importer is None:
Index: WAeUP_SRP/trunk/profiles/default/layouts/import.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/layouts/import.xml	(revision 1773)
+++ WAeUP_SRP/trunk/profiles/default/layouts/import.xml	(revision 1774)
@@ -33,4 +33,18 @@
   <property name="vocabulary">import_names</property>
  </widget>
+ <widget name="import_or_edit" meta_type="Boolean Widget">
+  <property name="title">Sex</property>
+  <property name="fields">
+   <element value="import_or_edit"/>
+  </property>
+  <property name="label">Import or Edit</property>
+  <property name="label_edit">Import or Edit</property>
+  <property name="readonly_layout_modes"/>
+  <property name="hidden_layout_modes"/>
+  <property name="hidden_readonly_layout_modes"/>
+  <property name="label_false">import</property>
+  <property name="label_true">edit</property>
+  <property name="render_format">select</property>
+ </widget>
  <table>
   <row>
@@ -40,4 +54,7 @@
    <cell name="name"/>
   </row>
+  <row>
+   <cell name="import_or_edit"/>
+  </row>
  </table>
   
Index: WAeUP_SRP/trunk/profiles/default/schemas/import.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/schemas/import.xml	(revision 1773)
+++ WAeUP_SRP/trunk/profiles/default/schemas/import.xml	(revision 1774)
@@ -3,3 +3,4 @@
  <field name="filename" meta_type="CPS String Field"/>
  <field name="name" meta_type="CPS String Field"/>
+ <field name="import_or_edit" meta_type="CPS Boolean Field"/>
 </object>
Index: WAeUP_SRP/trunk/skins/waeup_default/import.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_default/import.py	(revision 1773)
+++ WAeUP_SRP/trunk/skins/waeup_default/import.py	(revision 1774)
@@ -25,15 +25,18 @@
 if psm == 'invalid':
     return context.import_form(rendered = res,
-                                 psm = "Please correct your input!",
-                                 ds = ds,
-                                 )
+                               psm = "Please correct your input!",
+                               ds = ds,
+                              )
 elif psm == '':
     return context.import_form(rendered = res,
-                                 psm = None,
-                                 ds = ds,
-                                 )
+                               psm = None,
+                               ds = ds,
+                              )
 elif psm == 'valid':
     pass
-psm = context.waeup_tool.importData(ds.get('filename'),ds.get('name'))
+psm = context.waeup_tool.importData(ds.get('filename'),
+                                    ds.get('name'),
+                                    ds.get('import_or_edit')
+                                   )
 return context.import_form(rendered = res,
                                  psm = psm,
