source: WAeUP_SRP/trunk/skins/waeup_default/getSessionsVoc.py @ 17877

Last change on this file since 17877 was 5501, checked in by Henrik Bettermann, 14 years ago

logged_in.py: copy images in state student_created

getSessionsVoc.py: extend to 2015

File size: 523 bytes
RevLine 
[2653]1##parameters=key=None
2# $Id: getSessionsVoc.py 1986 2007-07-05 09:10:38Z henrik $
3"""
4Return the sessions as a vocabulary
5
6"""
7if key is None:
8    # not used for WAeUPSessionWidget, only for SelectWidget
[3085]9    l = [('','')]
[5501]10    for y in range(1998,2015):
[2653]11        l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1)))
12    return l
13
14try:
15    y = int(key)
16except:
[3254]17    raise KeyError
[2653]18if y == -1:
[3254]19    raise KeyError
[2653]20if y < 90:
21    cent = 2000
[3480]22elif y > 1000:
23    cent = 0
[2653]24else:
25    cent = 1900
26return "%4d/%4d" % (cent+y, cent+y+1)
27
Note: See TracBrowser for help on using the repository browser.