Ignore:
Timestamp:
17 Mar 2008, 10:54:14 (17 years ago)
Author:
joachim
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_academics/getCertificatesDict.py

    r3339 r3346  
    33"""
    44Return the certificates as dictionary
    5 
    6 """
    75
    86try:
     
    119    def set_trace():
    1210        pass
     11"""
    1312
    14 if key is None:
    15     res = context.portal_catalog.search({'meta_type': "Certificate"})
    16     dict = {}
    17    
    18     for d in res:
    19         c = d.getObject().getContent()
    20         if not hasattr(c,'study_mode'):
    21             continue
    22         dict[d.getId] = (c.title,c.study_mode)
    23     #set_trace()   
    24     return dict
     13res = context.portal_catalog.search({'meta_type': "Certificate"})
     14dict = {}
    2515
    26 res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key})
    27 if res:
    28     return res[0].Title
    29 raise KeyError
     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 TracChangeset for help on using the changeset viewer.