Changeset 3219
- Timestamp:
- 25 Feb 2008, 12:40:14 (17 years ago)
- Location:
- WAeUP_SRP/base
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPImport.py
r3208 r3219 104 104 for widget in self.layout.keys(): 105 105 self.validators[widget] = self.layout[widget].validate 106 self.required_keys = {} 107 for mode in self.required_modes: 108 self.required_keys[mode] = [self.layout.getIdUnprefixed(id) 109 for id,widget in self.layout.objectItems() 110 if widget.is_required] 106 111 self.init_errors = ','.join(errors) 107 112 … … 279 284 plural_name = "%ss" % name 280 285 commit_after = 1000000 286 required_modes = ('create','edit') 281 287 282 288 def getStudentRecord(self,mapping): ###( … … 405 411 plural_name = "%ss" % name 406 412 commit_after = 100000 413 required_modes = ('create','edit') 407 414 408 415 def create(self,mapping): -
WAeUP_SRP/base/WAeUPTool.py
r3205 r3219 1 # -*- mode: python; mode: fold-*-1 # -*- mode: python; mode: fold; -*- 2 2 # (C) Copyright 2005 The WAeUP group <http://www.waeup.org> 3 3 # Author: Joachim Schmitz (js@aixtraware.de) … … 1440 1440 msg = 'not ignorable key(s): "%s" found in heading' % ", ".join(diff2schema) 1441 1441 return msg 1442 # if import_mode in importer.required_modes:1443 # required_keys = [importer.layout.getIdUnprefixed(id)1444 # for id,widget in importer.layout.objectItems()1445 # if widget.is_required]1446 # if not set(required_keys).issubset(set(import_keys)):1447 # diff2import = set(required_keys).difference(set(import_keys))1448 # msg = 'required key(s): "%s" not found in heading' % ", ".join(diff2import)1449 # return msg1450 1442 # 1451 1443 # start importing … … 1486 1478 total += 1 1487 1479 import_mode = item.get('import_mode','edit') 1480 if (import_mode in importer.required_modes and 1481 not set(importer.required_keys[import_mode]).issubset(set(import_keys))): 1482 diff2import = set(importer.required_keys[import_mode]).difference(set(import_keys)) 1483 error_string += 'required key(s): "%s" not found in heading' % ", ".join(diff2import) 1488 1484 import_method = getattr(importer, '%(import_mode)s' % vars(),None ) 1489 1485 if import_method is None: -
WAeUP_SRP/base/Widgets.py
r3200 r3219 444 444 datastructure.setError(widget_id, "'%s' not a valid level" % v) 445 445 return 0 446 if self.is_required and not len(v):447 datastructure.setError(widget_id, "level key required")448 return 0446 # if self.is_required and len(v) == 0: 447 # datastructure.setError(widget_id, "level key required") 448 # return 0 449 449 450 450 datamodel = datastructure.getDataModel() … … 519 519 datastructure.setError(widget_id, "'%s' not a valid verdict key" % v) 520 520 return 0 521 if self.is_required and not len(v):522 datastructure.setError(widget_id, "verdict required")523 return 0521 # if self.is_required and not len(v): 522 # datastructure.setError(widget_id, "verdict required") 523 # return 0 524 524 525 525 datamodel = datastructure.getDataModel()
Note: See TracChangeset for help on using the changeset viewer.