source: WAeUP_SRP/base/skins/waeup_academics/getCertificatesList.py @ 3337

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

ticket #507 (not yet finished)

Upload.py: fix security declaration

File size: 635 bytes
Line 
1##parameters=key=None
2# $Id: getCertificatesVoc.py 3254 2008-02-28 13:06:20Z joachim $
3"""
4Return the certificates as list
5
6"""
7
8try:
9    from Products.zdb import set_trace
10except:
11    def set_trace():
12        pass
13
14if key is None:
15    res = context.portal_catalog.search({'meta_type': "Certificate"})
16    l = []
17    #set_trace()
18    for d in res:
19        c = d.getObject().getContent()
20        if not hasattr(c,'study_mode'):
21            continue
22        l.append((d.getId,c.title,c.study_mode))
23    return l
24
25res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key})
26if res:
27    return res[0].Title
28raise KeyError
Note: See TracBrowser for help on using the repository browser.