Hello folks,
I just played around with the validation of the schemata and created the
example listed below. According to the book by Philip it should rase a
validation exception at the end. That's what the FieldProperty is
supposed to do, but it does not do it here. (Tested in the zope debug
console) Why?

from zope.interface import Interface, implements
from zope.schema import Int
from zope.schema.fieldproperty import FieldProperty

class ITest(Interface):
    number = Int( title = u'A number' )

class test(object):
    number = FieldProperty(ITest['number'])

test_class = test()
print test.number  # get <zope.schema.fieldproperty.FieldProperty object at 

test.number = 20  # this is ok
print test.number  # get 20

test.number = "not an int"  # should raise exception, does not, why?

Sebastian Bartos, <seth.kriti...@googlemail.com>
keyserevr: pgp.mit.edu

Attachment: signature.asc
Description: This is a digitally signed message part

Zope3-users mailing list

Reply via email to