Changeset 3346 for WAeUP_SRP/base/skins/waeup_academics
- Timestamp:
- 17 Mar 2008, 10:54:14 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_academics/getCertificatesDict.py
r3339 r3346 3 3 """ 4 4 Return the certificates as dictionary 5 6 """7 5 8 6 try: … … 11 9 def set_trace(): 12 10 pass 11 """ 13 12 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 13 res = context.portal_catalog.search({'meta_type': "Certificate"}) 14 dict = {} 25 15 26 res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key}) 27 if res: 28 return res[0].Title 29 raise KeyError 16 for 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 } 24 return dict 25
Note: See TracChangeset for help on using the changeset viewer.