source: WAeUP_SRP/base/skins/waeup_academics/getCertificatesDict.py @ 3492

Last change on this file since 3492 was 3346, checked in by joachim, 17 years ago

fix for #108 fceokene: additional commas in csv-files are ignored
getCertificatesDict now returns a dictionary of dictinaries
admitOne uses it.

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