[Product-Developers] registering a standard validator

Andreas Petermann petepetermann at googlemail.com
Sun Aug 17 13:39:34 UTC 2008


Andreas Jung schrieb:
>
>
> --On 16. August 2008 18:27:45 +0200 Andreas Petermann 
> <petepetermann at googlemail.com> wrote:
>
>> Hi list,
>> i am new to plone and i am wondering if it is possible to add a standard
>> validator to every field without adding it to the field definitions?
>
> Why not?
>
>> I
>> know it is possible to define a new field class which uses the special
>> validator as the default one but i do not want to define for every
>> existing field a new one.
>
> Declaring a validator for each field is just one-line-more within the 
> field definition within a schema...possibly less work than writing 
> this posting.
Yes of course this would do the job.
> The field definition should explicitly define a field in one place - 
> this includes the definition of the validators - except you 
> implementation validation on the application - either through one of 
> the various AT hooks or through validate_XXX() methods.
>
> -aj
I am working on a product, which should make transclusions possible in 
plone without hacking the plone/zope code. For this it should be 
possible to add a transclusion rule (perhaps similar to wiki style 
{{USER:CONTENT}}) in text fields. The first idea was to add a special 
validator for this to check correct syntax. Because it should be 
possible for every text fields in every content type, the use of 
standard validators would be the easiest way.

regards
pete




More information about the Product-Developers mailing list