Index: WAeUP_SRP/trunk/WAeUPTables.py
===================================================================
--- WAeUP_SRP/trunk/WAeUPTables.py	(revision 2068)
+++ WAeUP_SRP/trunk/WAeUPTables.py	(revision 2069)
@@ -89,14 +89,15 @@
         raise NotImplemented
 
-    def modifyRecord(self, **data):
+    def modifyRecord(self, record=None, **data):
         #records = self.searchResults(uid=uid)
         uid = data[self.key]
-        records = self.searchResults({"%s" % self.key : uid})
-        if len(records) > 1:
-            # Can not happen, but anyway...
-            raise ValueError("More than one record with uid %s" % uid)
-        if len(records) == 0:
-            raise KeyError("No record for uid %s" % uid)
-        record = records[0]
+        if record is None:
+            records = self.searchResults({"%s" % self.key : uid})
+            if len(records) > 1:
+                # Can not happen, but anyway...
+                raise ValueError("More than one record with uid %s" % uid)
+            if len(records) == 0:
+                raise KeyError("No record for uid %s" % uid)
+            record = records[0]
         record_data = {}
         for field in self.schema() + self.indexes():
@@ -237,40 +238,43 @@
     affected_types = {   ###(
                       'StudentApplication':
-                          {'id': 'application',
-                           'fields':
-                             ('jamb_reg_no',
-                              'entry_mode',
-                              #'entry_level',
-                              'entry_session',
-                              )
-                              },
+                      {'id': 'application',
+                       'fields':
+                       ('jamb_reg_no',
+                        'entry_mode',
+                        #'entry_level',
+                        'entry_session',
+                       )
+                      },
                       'StudentClearance':
-                          {'id': 'clearance',
-                           'fields':
-                             ('matric_no',
-                              )
-                              },
-                         'StudentPersonal':
-                          {'id': 'personal',
-                           'fields':
-                             ('name',
-                              'sex',
-                              'email',
-                              'phone',
-                              )
-                              },
-                         'StudentStudyCourse':
-                          {'id': 'study_course',
-                           'fields':
-                             ('course',
-                              'faculty',
-                              'department',
-                              'level',
-                              'mode',
-                              'session',
-                              'verdict',
-                              )
-                              },
-                         }
+                      {'id': 'clearance',
+                       'fields':
+                       ('matric_no',
+                        'lga',
+                       )
+                      },
+                      'StudentPersonal':
+                      {'id': 'personal',
+                       'fields':
+                       ('name',
+                        'sex',
+                        'perm_address',
+                        'email',
+                        'phone',
+                       )
+                      },
+                      'StudentStudyCourse':
+                      {'id': 'study_course',
+                       'fields':
+                       ('course', # study_course
+                        'faculty', # from certificate
+                        'department', # from certificate
+                        'end_level', # from certificate
+                        'level', # current_level
+                        'mode',  # current_mode
+                        'session', # current_session
+                        'verdict', # current_verdict
+                       )
+                      },
+                     }
     ###)
 
@@ -326,4 +330,13 @@
             return None
         return certificate_res[0].getPath().split('/')[-4]
+
+    def get_from_doc_end_level(self,doc): ###(
+        "return the students end_level"
+        if doc is None:
+            return None
+        certificate_res = self.portal_catalog(id = doc.study_course)
+        if len(certificate_res) != 1:
+            return None
+        return getattr(certificate_res[0].getObject().getContent(),'end_level','unknown')
 
     def get_from_doc_level(self,doc):
@@ -579,5 +592,5 @@
             data['id'] = student_id
             data['registered_courses'] = registered_courses
-            self.modifyRecord(**data)
+            self.modifyRecord(record = student_rec, **data)
             return
         if pt not in self.affected_types.keys():
@@ -653,5 +666,5 @@
 
     meta_type = 'WAeUP Courses Catalog'
-    name = "students_catalog"
+    name = "courses_catalog"
     key = "code"
     def __init__(self):
@@ -782,4 +795,38 @@
 ###)
 
+class ResultsCatalog(WAeUPTable): ###(
+    security = ClassSecurityInfo()
+
+    meta_type = 'WAeUP Results Catalog'
+    name = "course_results"
+    key = "key"
+    def __init__(self):
+        WAeUPTable.__init__(self, 'course_results')
+
+    def manage_catalogReindex(self, REQUEST, RESPONSE, URL1): ###(
+        """ clear the catalog, then re-index everything """
+
+        elapse = time.time()
+        c_elapse = time.clock()
+
+        pgthreshold = self._getProgressThreshold()
+        handler = (pgthreshold > 0) and ZLogHandler(pgthreshold) or None
+        #self.refreshCatalog(clear=1, pghandler=handler)
+
+        elapse = time.time() - elapse
+        c_elapse = time.clock() - c_elapse
+
+        RESPONSE.redirect(
+            URL1 +
+            '/manage_catalogAdvanced?manage_tabs_message=' +
+            urllib.quote('Catalog Updated \n'
+                         'Total time: %s\n'
+                         'Total CPU time: %s' % (`elapse`, `c_elapse`)))
+    ###)
+
+
+InitializeClass(ResultsCatalog)
+###)
+
 class OnlinePaymentsImport(WAeUPTable): ###(
 
@@ -791,5 +838,5 @@
 
 
-InitializeClass(CoursesCatalog)
+InitializeClass(OnlinePaymentsImport)
 ###)
 
Index: WAeUP_SRP/trunk/profiles/default/students_catalog.xml
===================================================================
--- WAeUP_SRP/trunk/profiles/default/students_catalog.xml	(revision 2068)
+++ WAeUP_SRP/trunk/profiles/default/students_catalog.xml	(revision 2069)
@@ -15,4 +15,7 @@
  <index name="name" meta_type="TextIndex">
   <indexed_attr value="name"/>
+ </index>
+ <index name="perm_address" meta_type="TextIndex">
+  <indexed_attr value="perm_address"/>
  </index>
  <index name="jamb_reg_no" meta_type="FieldIndex">
@@ -40,4 +43,10 @@
   <indexed_attr value="level"/>
  </index>
+ <index name="end_level" meta_type="FieldIndex">
+  <indexed_attr value="end_level"/>
+ </index>
+ <index name="lga" meta_type="FieldIndex">
+  <indexed_attr value="lga"/>
+ </index>
  <index name="mode" meta_type="FieldIndex">
   <indexed_attr value="mode"/>
@@ -62,7 +71,10 @@
  <column value="course"/>
  <column value="registered_courses"/>
+ <column value="lga"/>
+ <column value="perm_address"/>
  <column value="email"/>
  <column value="phone"/>
  <column value="level"/>
+ <column value="end_level"/>
  <column value="mode"/>
  <column value="verdict"/>
