[Zope3-Users] Set & List constraints
Markus Kemmerling
markus.kemmerling at meduniwien.ac.at
Thu Jul 10 10:59:01 EDT 2008
Am 10.07.2008 um 16:44 schrieb Tim Cook:
> When constraining the membership of zope.schema List and Set; is it
> valid to say that this will work:
>
>
> value=List(
> title=u"Value",
> constraint=classProvides(IMyClass)
> )
>
>
> where IMyClass defines the schema for the MyClass and is the only
> objects allowed in the List?
I would rather say:
value=List(
title=u"Value",
value_type=Object(schema=IMyClass)
)
Anyhow, such a constraint is of limited use only, since it does not
prevent you from adding any object you like to the list *after* it
got assigned to the 'value' attribute.
Regards,
Markus Kemmerling
More information about the Zope3-users
mailing list