Changeset 7837


Ignore:
Timestamp:
11 Mar 2012, 16:00:24 (13 years ago)
Author:
Henrik Bettermann
Message:

Use dictionaries from KofaUtils?.

File:
1 edited

Legend:

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

    r7828 r7837  
    8080    )
    8181
    82 SUBJECTS = dict(math=_(u'Math'),
    83                 bio=_(u'Biology'),
    84                 eng=_(u'English'),
    85                 )
    8682class SubjectSource(BasicSourceFactory):
     83
    8784    def getValues(self):
    88         return sorted(SUBJECTS.keys())
     85        subjects_dict = getUtility(IKofaUtils).getExamSubjectsDict()
     86        return sorted(subjects_dict.keys())
     87
    8988    def getTitle(self, value):
    90         return "%s:" % SUBJECTS.get(value, None)
    91 
    92 GRADES = {'A':_(u'Very Good'),
    93           'B':_(u'Good'),
    94           'C':_(u'Satisfactory'),
    95           'D':_(u'Sufficient'),
    96           'E':_(u'Fail'),
    97           }
     89        subjects_dict = getUtility(IKofaUtils).getExamSubjectsDict()
     90        return "%s:" % subjects_dict[value]
     91
    9892class GradeSource(BasicSourceFactory):
     93
    9994    def getValues(self):
    100         return sorted(GRADES.keys())
     95        grades_dict = getUtility(IKofaUtils).getExamGradesDict()
     96        return sorted(grades_dict.keys())
     97
    10198    def getTitle(self, value):
    102         return GRADES.get(value, None)
     99        grades_dict = getUtility(IKofaUtils).getExamGradesDict()
     100        return grades_dict[value]
    103101
    104102# Define a valiation method for email addresses
Note: See TracChangeset for help on using the changeset viewer.