Ignore:
Timestamp:
17 Mar 2013, 14:45:18 (12 years ago)
Author:
Henrik Bettermann
Message:

Add module for student related XMLRPC web services and move get_student_id method.

Location:
main/waeup.kofa/trunk/src/waeup/kofa
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/webservices.py

    r10030 r10033  
    109109        """
    110110        return u'0.1'
    111 
    112     @grok.require('waeup.xmlrpc')
    113     def get_student_id(self, reg_number=None):
    114         """Get the id of a student with registration number `reg_number`.
    115 
    116         Returns the student id as string if successful, ``None`` else.
    117         """
    118         if reg_number is not None:
    119             cat = getUtility(ICatalog, name='students_catalog')
    120             result = list(
    121                 cat.searchResults(reg_number=(reg_number, reg_number),
    122                                   _limit=1))
    123             if not len(result):
    124                 return None
    125             return result[0].student_id
    126         return None
Note: See TracChangeset for help on using the changeset viewer.