Ignore:
Timestamp:
28 Sep 2007, 08:54:17 (17 years ago)
Author:
joachim
Message:

use WAeUPId Widget for Ids

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Widgets.py

    r2282 r2289  
    624624    def validate(self, datastructure, **kw):
    625625        """Validate datastructure and update datamodel."""
    626 
     626        mode = kw.get('mode','create')
    627627        valid = CPSStringWidget.validate(self, datastructure, **kw)
    628628        id_pat_str = r"\S"
     
    642642            if len(value.split()) > 1:
    643643                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):
    645646                brain = self.portal_catalog(portal_type=portal_type_query,id=value)[0]
    646647                err = 'An ${portal_type} object with the Id ${id} already exists at ${path}.'
Note: See TracChangeset for help on using the changeset viewer.