Changeset 6109 for main


Ignore:
Timestamp:
16 May 2011, 05:52:41 (13 years ago)
Author:
Henrik Bettermann
Message:

Use a simple static list for year pull-down menus instead of source.

File:
1 edited

Legend:

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

    r6101 r6109  
    6767application_types_vocab = SimpleWAeUPVocabulary(*APPLICATION_TYPES)
    6868
    69 class FutureYearsSource(BasicSourceFactory):
    70     """XXX: We will soon add an explanation why we don't use a simple
    71        static list returned from a two-line function here.
    72     """
    73     def getValues(self):
    74         curr_year = datetime.now().year
    75         return range(curr_year - 2, curr_year + 5)
     69def yeararrange():
     70    curr_year = datetime.now().year
     71    return range(curr_year - 2, curr_year + 5)
    7672
    7773class GenderSource(BasicSourceFactory):
     
    188184        required = True,
    189185        default = None,
    190         source = FutureYearsSource(),
     186        values = yeararrange(),
    191187        readonly = True,
    192188        )
     
    269265        required = True,
    270266        default = None,
    271         source = FutureYearsSource(),
     267        values = yeararrange(),
    272268        readonly = False,
    273269        )
Note: See TracChangeset for help on using the changeset viewer.