Changeset 3346


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.

Location:
WAeUP_SRP/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3341 r3346  
    943943        da['app_mobile'] = brain.phone
    944944
    945         da['entry_mode'] = self._v_certificates[brain.course_admitted][1]
     945        da['entry_mode'] = self._v_certificates[brain.course_admitted]['study_mode']
    946946
    947947        #if brain.entry_mode:
     
    14021402        if filename == pend_str:
    14031403            pending_only = True
    1404         # mode = "create"
    1405         # if edit:
    1406         #     if filename.endswith('_toDelete'):
    1407         #         mode = "delete"
    1408         #     else:
    1409         #         mode = "edit"
    14101404        importer_name = ''.join([part.capitalize() for part in name.split('_')])
    14111405        importer = eval("%sImport" % importer_name)(self)
     
    15131507            empty_value_keys = []
    15141508            for k,v in record.items():
     1509                if k is None:
     1510                    continue
    15151511                if v:
    15161512                    if v == EMPTY:
  • 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.