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
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to