Changeset 1902


Ignore:
Timestamp:
15 Jun 2007, 16:48:48 (18 years ago)
Author:
joachim
Message:

search for reg_no in students_catalog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Students.py

    r1894 r1902  
    6666def getStudentByRegNo(self,reg_no): ###(
    6767    """search student by JAMB Reg No and return StudentFolder"""
    68     search = ZCatalog.searchResults(self.portal_catalog_real,{'meta_type': 'StudentApplication',
    69                                   'SearchableText': reg_no,
    70                                   })
    71     if len(search) < 1:
     68    res = self.students_catalog(jamb_reg_no = reg_no)
     69    if len(res) == 1:
     70        return getattr(self.portal_url.getPortalObject().campus.students,res[0].id)
     71    else:
    7272        return None
    73     return search[0].getObject().aq_parent
     73    # don't search in portal_catalog
     74    # search = ZCatalog.searchResults(self.portal_catalog_real,{'meta_type': 'StudentApplication',
     75    #                               'SearchableText': reg_no,
     76    #                               })
     77    # if len(search) < 1:
     78    #     return None
     79    # return search[0].getObject().aq_parent
    7480
    7581###)
Note: See TracChangeset for help on using the changeset viewer.