Changeset 10184 for main/waeup.kofa


Ignore:
Timestamp:
22 May 2013, 06:44:00 (11 years ago)
Author:
Henrik Bettermann
Message:

Prepare AppCatCertificateSource? for customization. FUTMinna requires additional criteria for filtering certificates.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

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

    r10098 r10184  
    9191
    9292    def getValues(self, context):
    93         # appliction category not available when certificate was deleted.
    94         # shouldn't that info be part of applicant info instead?
    95         # when we cannot determine the appcat, we will display all courses.
    9693        appcat = getattr(getattr(context, '__parent__', None),
    9794                         'application_category', None)
     
    9996        result = catalog.searchResults(
    10097            application_category=(appcat,appcat))
    101         result = sorted(result, key=lambda value: value.code)
    102         # XXX: What does the following mean here?
     98        result = getUtility(
     99            IApplicantsUtils).filterCertificates(result)
    103100        curr_course = context.course1
    104101        if curr_course is not None and curr_course not in result:
    105             # display also current course even if it is not catalogued
    106             # (any more)
     102            # display also current course even if certificate has been removed
    107103            result = [curr_course,] + result
    108104        return result
     
    153149    """
    154150
    155     APP_TYPES_DICT = Attribute(' dict of application types')
     151    APP_TYPES_DICT = Attribute('dict of application types')
     152
     153    def setPaymentDetails(container, payment):
     154        """Set the payment data of an applicant.
     155        """
     156
     157    def getApplicantsStatistics(container):
     158        """Count applicants in containers.
     159        """
     160
     161    def filterCertificates(resultset):
     162        """Filter and sort certificates for AppCatCertificateSource.
     163        """
    156164
    157165class IApplicantsRoot(IKofaObject, IContainer):
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r9047 r10184  
    6363
    6464    def getApplicantsStatistics(self, container):
     65        """Count applicants in containers.
     66        """
    6567        state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
    6668            ADMITTED:0, NOT_ADMITTED:0, CREATED:0}
     
    7577                applicant_id=(code, mxcode)))
    7678        return state_stats, None
     79
     80    def filterCertificates(self, resultset):
     81        """Filter and sort certificates for AppCatCertificateSource.
     82        """
     83        return sorted(resultset, key=lambda value: value.code)
Note: See TracChangeset for help on using the changeset viewer.