[Grok-dev] validators

Thomas Bellembois thomas.bellembois at gmail.com
Wed Aug 12 05:22:55 EDT 2009


Hello Sebastian,

Actually the field I want to validate is *not* one of the 4 fields of my
Molecule class.
I have a 1->* relationship between the "Molecule" container and a "Family"
container.
So I have modified the default Molecule homastemplate file to add a drop
down list with the families.
I want to validate this drop down list (make it required).

Thanks for your help.

Regards,

Thomas

On Tue, Aug 11, 2009 at 1:35 PM, Sebastian Ware <sebastian at urbantalk.se>wrote:

> You would normally do this in the interface and have the edit/add views
> enforce the data integrity. If this solves your problem you could look at
> this document:
>
> http://grok.zope.org/documentation/tutorial/work-with-forms
>
> Mvh Sebastian
>
> 10 aug 2009 kl. 18.47 skrev Thomas Bellembois:
>
>  Hello,
>>
>> Where can we find a documentation about validators ? How can we create a
>> custom validator to overide the default validator ?
>> I have a container "Molecule" with 4 fields:
>>
>> class Molecule(grok.Container):
>>    interface.implements(IMolecule)
>>    cas_number = u''
>>    ce_number = u''
>>    remark = u'--'
>>
>> and I have added a drop down list in the default template file to add
>> another field (like a foreign key). I would like this drop down list to be a
>> required field.
>>
>> Thanks for your help.
>>
>> Thomas
>> _______________________________________________
>> Grok-dev mailing list
>> Grok-dev at zope.org
>> http://mail.zope.org/mailman/listinfo/grok-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20090812/49868c7f/attachment.html 


More information about the Grok-dev mailing list