Changeset 3487
- Timestamp:
- 3 May 2008, 15:10:45 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/Widgets.py
r3486 r3487 1030 1030 1031 1031 widgetRegistry.register(WAeUPSexWidget) 1032 1033 ###) 1034 1035 class WAeUPBooleanWidget(CPSBooleanWidget): ###( 1036 """WAeUP boolean widget.""" 1037 meta_type = 'WAeUP Boolean Widget' 1038 1039 def validate(self, datastructure, **kw): 1040 """Validate datastructure and update datamodel.""" 1041 value = datastructure[self.getWidgetId()] 1042 1043 if self.render_format not in self.render_formats: 1044 self.render_format = 'select' 1045 true = value.upper() in ('T','1','TRUE',True) 1046 false = value.upper() in ('F','0','FALSE',False) 1047 if not true and not false: 1048 datastructure.setError(self.getWidgetId(), 1049 "invalid boolean %s" % value) 1050 return 0 1051 elif true: 1052 v = True 1053 else: 1054 v = False 1055 datamodel = datastructure.getDataModel() 1056 datamodel[self.fields[0]] = v 1057 return 1 1058 1059 InitializeClass(WAeUPBooleanWidget) 1060 1061 widgetRegistry.register(WAeUPBooleanWidget) 1032 1062 1033 1063 ###) -
WAeUP_SRP/uniben/profiles/default/layouts/import_course_result.xml
r3450 r3487 97 97 </widget> 98 98 99 <widget name="core_or_elective" meta_type=" Boolean Widget">99 <widget name="core_or_elective" meta_type="WAeUP Boolean Widget"> 100 100 <property name="title">Core or Elective</property> 101 101 <property name="fields"> … … 111 111 </widget> 112 112 113 <widget name="carry_over" meta_type=" Boolean Widget">113 <widget name="carry_over" meta_type="WAeUP Boolean Widget"> 114 114 <property name="title">carry over</property> 115 115 <property name="fields">
Note: See TracChangeset for help on using the changeset viewer.