Ignore:
Timestamp:
1 Jun 2012, 11:25:22 (12 years ago)
Author:
Henrik Bettermann
Message:

Extend applicants statistics.

File:
1 edited

Legend:

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

    r8563 r8591  
    9999    @property
    100100    def statistics(self):
    101         statistics = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
     101        state_stats = {INITIALIZED:0, STARTED:0, PAID:0, SUBMITTED:0,
    102102            ADMITTED:0, NOT_ADMITTED:0, CREATED:0}
     103        faculty_keys = grok.getSite()['faculties'].keys()
     104        fac_stats = dict([(i,0) for i in faculty_keys])
    103105        for key in self.keys():
    104             statistics[self[key].state] += 1
    105         return statistics
     106            state_stats[self[key].state] += 1
     107            cert = getattr(self[key],'course1',None)
     108            if  cert is not None:
     109                faculty = cert.__parent__.__parent__.__parent__
     110                fac_stats[faculty.__name__] += 1
     111        return state_stats, fac_stats
    106112
    107113ApplicantsContainer = attrs_to_fields(ApplicantsContainer)
Note: See TracChangeset for help on using the changeset viewer.