Last change
on this file since 3028 was
2757,
checked in by Henrik Bettermann, 17 years ago
|
revised study_level_view and methods
|
File size:
488 bytes
|
Rev | Line | |
---|
[2653] | 1 | ##parameters=key=None |
---|
| 2 | # $Id: getSessionsVoc.py 1986 2007-07-05 09:10:38Z henrik $ |
---|
| 3 | """ |
---|
| 4 | Return the sessions as a vocabulary |
---|
| 5 | |
---|
| 6 | """ |
---|
| 7 | if key is None: |
---|
| 8 | # not used for WAeUPSessionWidget, only for SelectWidget |
---|
| 9 | l = [('-1','')] |
---|
| 10 | for y in range(1998,2010): |
---|
| 11 | l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1))) |
---|
| 12 | return l |
---|
| 13 | |
---|
| 14 | try: |
---|
| 15 | y = int(key) |
---|
| 16 | except: |
---|
[2757] | 17 | return key |
---|
[2653] | 18 | if y == -1: |
---|
| 19 | return '' |
---|
| 20 | if y < 90: |
---|
| 21 | cent = 2000 |
---|
| 22 | else: |
---|
| 23 | cent = 1900 |
---|
| 24 | return "%4d/%4d" % (cent+y, cent+y+1) |
---|
| 25 | |
---|
Note: See
TracBrowser for help on using the repository browser.