[Zope3-dev] Sequence Validation

Eckart Hertzler hertzler.eckart at guj.de
Mon Jun 7 04:17:14 EDT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have a question about the schema validation of sequences.

The fields (for example IList ) all use _validate_sequence for the validation
of the items.
This method loops through the items :

    for item in value:
        error = None
        try:
            value_type.validate(item)
        except ValidationError, error:
            pass
        else:
            # We validated, so clear error (if any) and done with
            # this value
            error = None
            break

        if error is not None:
            errors.append(error)


Why does the loop break, if one correct item was found ?
This way if the first Item is correct and all other items are not, the 
validation succeeds anyway. This is not, what I would have expected...

Feature or Bug ?

Regards

Eckart

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAxCSNhG4SSzcwNxgRAnsOAJoCmXhJgoHGYtELyhzDxJb71UQh6wCgg7ZR
bCfSrcNE5H/YVC7U9E46EJE=
=P3lc
-----END PGP SIGNATURE-----



More information about the Zope3-dev mailing list