Index: WAeUP_SRP/trunk/WAeUPTool.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTool.py	(revision 1169)
+++ WAeUP_SRP/trunk/WAeUPTool.py	(revision 1170)
@@ -37,4 +37,5 @@
 from Students import makeCertificateCode
 import logging
+import transaction
 
 
@@ -63,4 +64,27 @@
             sid = "%c%d" % (letter,r.randint(99999,1000000))
         return sid
+    ###)
+
+    security.declareProtected(ModifyPortalContent,'createOne') ###(
+    def createOne(self,student_brain,commit=False): 
+        students_folder = self.portal_url.getPortalObject().campus.students
+        sid = self.waeup_tool.generateStudentId('?')
+        students_folder.invokeFactory('Student', sid)
+        student = getattr(students_folder,sid)
+        self.portal_workflow.doActionFor(student,'return')
+        student.manage_setLocalRoles(sid, ['Owner',])
+        matric_no = student_brain.matric_no
+        jamb_reg_no = student_brain.Entryregno
+        self.students_catalog.addRecord(id = sid,
+                                           matric_no = matric_no,
+                                           jamb_reg_no = jamb_reg_no,
+                                           sex = student_brain.Sex == "F",
+                                           name = "%s %s %s" % (student_brain.Firstname,
+                                                                student_brain.Middlename,
+                                                                student_brain.Lastname)
+                                        )
+        if commit:
+            transaction.commit()
+        return sid,jamb_reg_no
     ###)
 
Index: WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py	(revision 1169)
+++ WAeUP_SRP/trunk/skins/waeup_student/createReturningStudent.py	(revision 1170)
@@ -21,28 +21,52 @@
 #if str(member) not in ("admin","joachim"):
 #    return "not possible"
+def createOne(student_brain):
+    sid = context.waeup_tool.generateStudentId('?')
+    students_folder.invokeFactory('Student', sid)
+    student = getattr(students_folder,sid)
+    wftool.doActionFor(student,'return')
+    student.manage_setLocalRoles(sid, ['Owner',])
+    jamb_reg_no = student_brain.Entryregno,
+    context.students_catalog.addRecord(id = sid,
+                                       matric_no = matric_no,
+                                       jamb_reg_no = jamb_reg_no,
+                                       sex = student_brain.Sex == "F",
+                                       name = "%s %s %s" % (student_brain.Firstname,
+                                                            student_brain.Middlename,
+                                                            student_brain.Lastname)
+                                    )
+    return sid,jamb_reg_no
+
 if not matric_no:
     return "No MatricNo"
 
-if context.students_catalog(matric_no=matric_no):
-    return "Student with %s already exists" % matric_no
-res = context.returning_import(matric_no = matric_no)
-if len(res) != 1:
-    return "MatricNo %s not found in Returning Table" % matric_no
-student_brain = res[0]
-sid = context.waeup_tool.generateStudentId('?')
-students_folder.invokeFactory('Student', sid)
-logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
-student = getattr(students_folder,sid)
-wftool.doActionFor(student,'return')
-student.manage_setLocalRoles(sid, ['Owner',])
-jamb_reg_no = student_brain.Entryregno,
-context.students_catalog.addRecord(id = sid,
-                                   matric_no = matric_no,
-                                   jamb_reg_no = jamb_reg_no,
-                                   sex = student_brain.Sex == "F",
-                                   name = "%s %s %s" % (student_brain.Firstname,
-                                                        student_brain.Middlename,
-                                                        student_brain.Lastname)
-                                )
-return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no)
+if matric_no != 'All':
+    if context.students_catalog(matric_no=matric_no):
+        return "Student with %s already exists" % matric_no
+    res = context.returning_import(matric_no = matric_no)
+    if len(res) != 1:
+        return "MatricNo %s not found in Returning Table" % matric_no
+    student_brain = res[0]
+    #sid,jamb_reg_no = context.waeup_tool.createOne(student_brain)
+    sid,jamb_reg_no = context.createOne(student_brain)
+    logger.info('"%s","Created Student","%s", "%s" ' % (member,sid,matric_no))
+    return "Student MatricNo %s, StudentId %s Jamb %s created" % (matric_no,sid,jamb_reg_no)
 
+students = context.returning_import(emil="adf")
+count = 1
+total = 0
+logger.info('"%s","Create Students start"' % (member))
+#from Products.zdb import set_trace;set_trace()
+for student in students:
+    if context.students_catalog(matric_no=student.matric_no):
+        logger.info('"Student already exists","%s"' % (student.matric_no))
+        continue
+    if count > 100:
+        context.waeup_tool.createOne(student,commit=True)
+        logger.info('"%s","Commited Students","%s", "%s" ' % (member,count,total))
+        total += count
+        count = 1
+    else:
+        context.waeup_tool.createOne(student)
+        count += 1
+logger.info('"%s","Create Students finish","%s"' % (member,total))
