Changeset 8647 for main


Ignore:
Timestamp:
7 Jun 2012, 18:37:06 (13 years ago)
Author:
Henrik Bettermann
Message:

Customized applicants statistics (temporarily disabled).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py

    r8561 r8647  
    2222import sys
    2323import grok
     24from zope.catalog.interfaces import ICatalog
    2425from hurry.workflow.interfaces import IWorkflowInfo, InvalidTransitionError
    2526from waeup.kofa.applicants.utils import ApplicantsUtils
     27from waeup.kofa.applicants.interfaces import IApplicantsUtils
     28from waeup.kofa.applicants.workflow import (INITIALIZED,
     29    STARTED, PAID, ADMITTED, NOT_ADMITTED, SUBMITTED, CREATED)
    2630from waeup.uniben.interfaces import MessageFactory as _
     31
    2732
    2833
     
    5863        'form.presently_inst': _(u'Presently attending a course or programme'),
    5964        }
     65
     66    # Temporarily disabled
     67    def xxx_getApplicantsStatistics(self, container):
     68        state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
     69            ADMITTED:0, NOT_ADMITTED:0, CREATED:0}
     70        faculty_keys = grok.getSite()['faculties'].keys()
     71        fac_stats = dict([(i,0) for i in faculty_keys])
     72        for key in container.keys():
     73            state = container[key].state
     74            state_stats[state] += 1
     75            cert = getattr(container[key],'course1',None)
     76            if  cert is not None and state == SUBMITTED:
     77                faculty = cert.__parent__.__parent__.__parent__
     78                fac_stats[faculty.__name__] += 1
     79        return state_stats, fac_stats
Note: See TracChangeset for help on using the changeset viewer.