source: WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py @ 2023

Last change on this file since 2023 was 1986, checked in by Henrik Bettermann, 17 years ago

show sessions, courselevel and entrymodes vocabularies in correct order, please check
(btw courselevel should be renamed to levels)

  • Property svn:keywords set to Id
File size: 445 bytes
RevLine 
[1736]1##parameters=key=None
[1728]2# $Id: sessions_voc.py 1986 2007-07-05 09:10:38Z henrik $
3"""
4Return the sessions as an vocabulary
5
6"""
7if key is None:
[1986]8    # not used for WAeUPSessionWidget, only for SelectWidget
9    l = [('-1','N/A')]
[1728]10    for y in range(1998,2008):
11        l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1)))
12    return l
13
14try:
15    y = int(key)
16except:
[1986]17    return 'N/A'
18if y == -1:
19    return 'N/A'
[1728]20if y < 90:
21    cent = 2000
22else:
23    cent = 1900
24return "%4d/%4d" % (cent+y, cent+y+1)
25
Note: See TracBrowser for help on using the repository browser.