Changeset 1366 for WAeUP_SRP/trunk/skins/waeup_default
- Timestamp:
- 27 Jan 2007, 15:40:19 (18 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_default
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_default/waeup_document_create_do.py
r731 r1366 9 9 """ 10 10 from Products.CMFCore.utils import getToolByName 11 11 request = context.REQUEST 12 12 if type_name in ("StudyLevel","StudentStudyLevel"): 13 13 id = datamodel.get('code') … … 34 34 if new_id is not None: 35 35 id = new_id 36 36 if type_name == "Course": 37 d = {} 38 ptl = request.get('PATH_TRANSLATED').split('/') 39 ai = ptl.index('academics') 40 d['faculty'] = ptl[ai+1] 41 d['department'] = ptl[ai+2] 42 from_dm = ('code','title','semester','credits',) 43 for f in from_dm: 44 d[f] = datamodel.get(f) 45 context.courses_catalog.addRecord(**d) 37 46 ob = getattr(context, id) 38 47 ob.getContent().edit(mapping=datamodel) -
WAeUP_SRP/trunk/skins/waeup_default/waeup_edit.py
r1350 r1366 40 40 41 41 action = "/" + came_from 42 43 42 if is_valid: 44 43 comments = REQUEST.get('comments') … … 74 73 ) 75 74 elif context.portal_type == "Course": 76 context.courses_catalog.modifyRecord(**ds) 75 dd = {} 76 dd.update(ds) # ds is not a real dictionary 77 try: 78 context.courses_catalog.modifyRecord(**dd) 79 except KeyError: 80 context.courses_catalog.addRecord(**dd) 77 81 if cpsdocument_edit_and_view_button is not None: 78 82 action = ''
Note: See TracChangeset for help on using the changeset viewer.