class IFieldEvent(Interface):

    field = Object(
        IField,
        description="The field that has been changed")

    object = Attribute("The object containing the field")
Exemple #2
0
class IMapping(IMinMaxLen, IIterable, IContainer):
    """
    Field containing an instance of :class:`collections.Mapping`.

    The *key_type* and *value_type* fields allow specification
    of restrictions for keys and values contained in the dict.

    """
    key_type = Object(
        IField,
        description=_("Field keys must conform to the given type, expressed "
                      "via a Field."))

    value_type = Object(
        IField,
        description=_("Field values must conform to the given type, expressed "
                      "via a Field."))
Exemple #3
0
class ICollection(IMinMaxLen, IIterable, IContainer):
    """Abstract interface containing a collection value.

    The Value must be iterable and may have a min_length/max_length.
    """

    value_type = Object(
        IField,
        title=_("Value Type"),
        description=_("Field value items must conform to the given type, "
                      "expressed via a Field."))

    unique = Bool(title=_('Unique Members'),
                  description=_(
                      'Specifies whether the members of the collection '
                      'must be unique.'),
                  default=False)
class IObject(IField):
    """
    Field containing an Object value.

    .. versionchanged:: 4.6.0
       Add the *validate_invariants* attribute.
    """

    schema = Object(
        IInterface,
        description=_("The Interface that defines the Fields comprising the Object.")
    )

    validate_invariants = Bool(
        title=_("Validate Invariants"),
        description=_("A boolean that says whether ``schema.validateInvariants`` "
                      "is called from ``self.validate()``. The default is true."),
        default=True,
    )