Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
let field choose if an attribute has to exist and not raise a key error
Browse files Browse the repository at this point in the history
  • Loading branch information
dobe committed Jan 16, 2007
1 parent 19d9a66 commit 528eefd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/z3c/configurator/README.txt
Expand Up @@ -117,7 +117,7 @@ The value must exist and be valid:
>>> configurator.configure(something, {'foo': u'my value'})
Traceback (most recent call last):
...
KeyError: 'bar'
RequiredMissing

>>> something = Something()
>>> configurator.configure(something, {'foo': u'my value', 'bar': 1})
Expand Down
2 changes: 1 addition & 1 deletion src/z3c/configurator/configurator.py
Expand Up @@ -98,7 +98,7 @@ def __init__(self, context):

def verify(self, data):
for name, field in zope.schema.getFields(self.schema).items():
field.validate(data[name])
field.validate(data.get(name))

def __call__(self, data):
raise NotImplemented

0 comments on commit 528eefd

Please sign in to comment.