Changeset 373
- Timestamp:
- 15 Aug 2006, 14:33:10 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r295 r373 72 72 ###) 73 73 74 class CPSStringWidgetForRecord(CPSStringWidget): 74 class CPSStringWidgetForRecord(CPSStringWidget): ###( 75 75 """String widget.""" 76 76 meta_type = 'String Widget For Record' … … 106 106 107 107 widgetRegistry.register(CPSStringWidgetForRecord) 108 109 ###) 110 111 class CertificateCourseIdWidget(CPSStringWidget): ###( 112 """ CertificateCourseId Widget""" 113 meta_type = "CertificateCourseId Widget" 114 115 def validate(self, datastructure, **kw): 116 """Validate datastructure and update datamodel.""" 117 118 valid = CPSStringWidget.validate(self, datastructure, **kw) 119 if not valid: 120 return 0 121 else: 122 widget_id = self.getWidgetId() 123 value = datastructure[widget_id].upper() 124 err = 0 125 c_ids = [c.id for c in self.portal_catalog({'meta_type': "Course"})] 126 if value not in c_ids: 127 err = 'Course %s does not exist' % (value) 128 if err: 129 datastructure.setError(widget_id, err) 130 else: 131 datamodel = datastructure.getDataModel() 132 datamodel[self.fields[0]] = value 133 134 return not err 135 136 InitializeClass(CertificateCourseIdWidget) 137 138 widgetRegistry.register(CertificateCourseIdWidget) 139 140 141 ###) 108 142 109 143 class StudentIdWidget(CPSStringWidget): ###( -
WAeUP_SRP/trunk/skins/waeup_default/waeup_document_create_do.py
r370 r373 33 33 34 34 ob = getattr(context, id) 35 ob.getContent().edit(mapping=datamodel) 35 36 36 37 context.notifyCPSDocumentCreation(ob=ob) # BBB obsolete in CPS 3.5.0
Note: See TracChangeset for help on using the changeset viewer.