- Timestamp:
- 28 Sep 2007, 08:54:17 (17 years ago)
- Location:
- WAeUP_SRP
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r2288 r2289 1032 1032 res = self.portal_catalog(id=course_id) 1033 1033 if not res: 1034 return '', "No Course with ID: %s" % did1034 return '', "No Course with ID: %s" % course_id 1035 1035 c = res[0].getObject() 1036 1036 c.getContent().edit(mapping=mapping) … … 1368 1368 validators[widget] = layout[widget].validate 1369 1369 #import pdb;pdb.set_trace() 1370 mode = "create" 1370 1371 if edit: 1371 importer_name = "mass_edit_%s" % name 1372 else: 1373 importer_name = "mass_create_%s" % name 1372 mode = "edit" 1373 importer_name = "mass_%(mode)s_%(name)s" % vars() 1374 1374 importer = getattr(self, '%s' % importer_name,None) 1375 1375 if importer is None: … … 1410 1410 for k in import_keys: 1411 1411 #import pdb;pdb.set_trace() 1412 if not validators[k](ds ):1412 if not validators[k](ds,mode=mode): 1413 1413 error_string += " %s : %s" % (k, 1414 1414 self.translation_service(ds.getError(k), -
WAeUP_SRP/base/Widgets.py
r2282 r2289 624 624 def validate(self, datastructure, **kw): 625 625 """Validate datastructure and update datamodel.""" 626 626 mode = kw.get('mode','create') 627 627 valid = CPSStringWidget.validate(self, datastructure, **kw) 628 628 id_pat_str = r"\S" … … 642 642 if len(value.split()) > 1: 643 643 err = 'Invalid Id, Id contains space(s).' 644 elif self.portal_catalog(portal_type=portal_type_query,id=value): 644 elif mode == "create" and\ 645 self.portal_catalog(portal_type=portal_type_query,id=value): 645 646 brain = self.portal_catalog(portal_type=portal_type_query,id=value)[0] 646 647 err = 'An ${portal_type} object with the Id ${id} already exists at ${path}.' -
WAeUP_SRP/fceokene/profiles/default/layouts/import_certificate.xml
r2282 r2289 18 18 <property name="size_max">200</property> 19 19 </widget> 20 <widget name="code" meta_type=" StringWidget">20 <widget name="code" meta_type="WAeUPId Widget"> 21 21 <property name="title">Certificate ID</property> 22 22 <property name="fields"> -
WAeUP_SRP/fceokene/profiles/default/layouts/import_course.xml
r2282 r2289 8 8 <property name="flexible_widgets"/> 9 9 <property name="validate_values_expr"></property> 10 <widget name="code" meta_type=" StringWidget">10 <widget name="code" meta_type="WAeUPId Widget"> 11 11 <property name="title">Course Id</property> 12 12 <property name="fields">
Note: See TracChangeset for help on using the changeset viewer.