Accueil / Blog / Métier / Archives / collective.z3cform.norobots: a captcha based on questions and answers

collective.z3cform.norobots: a captcha based on questions and answers

Par Sylvain Boureliou publié 15/01/2010, édité le 16/02/2016
I have released a new captcha widget/field for z3c.form in Plone. Unlike other captcha fields that are based on images, this captcha is based on a predefined list of questions and answers.


collective.z3cform.norobots provides a "human" captcha widget based on a list of questions/answers.

The widget is based on z3c.form.TextWidget.


  • tested with Plone 3.3.2


Just a simple easy_install collective.z3cform.norobots is enough.

Alternatively, buildout users can install collective.z3cform.norobots as part of a specific project's buildout, by having a buildout configuration such as:

eggs =
zcml =

In portal_setup, apply the profile collective.z3cform.norobots:default.

Add a new question

In the Plone Property Sheet "norobots_properties" (portal_properties/norobots_properties), add a new property:

Name: The question id (ex: "question4")
Value: your_question::the_answer (ex: "What is 10 + 12 ?::22")
Type: string


You can use this widget setting the "widgetFactory" property of a form field:

from zope import interface, schema
from z3c.form import interfaces, form, field, button, validator
from import wrap_form

from collective.z3cform.norobots.i18n import MessageFactory as _
from collective.z3cform.norobots.widget import NorobotsFieldWidget
from collective.z3cform.norobots.validator import NorobotsValidator

class INorobotsForm(interface.Interface):
    norobots = schema.TextLine(title=_(u'Are you a human ?'),
                               description=_(u'In order to avoid spam, please 
                                               answer the question below.'),

class NorobotsForm(form.Form):
    fields = field.Fields(INorobotsForm)
    fields['norobots'].widgetFactory = NorobotsFieldWidget

# wrap the form with's Form wrapper
NorobotsFormView = wrap_form(NorobotsForm)

# Register Norobots validator for the correponding field in the IContactInfo interface
validator.WidgetValidatorDiscriminators(NorobotsValidator, field=INorobotsForm['norobots'])

For more information see the example in the plone_forms directory in the package.

Integrated in a join form:

collective-z3cform-norobots: Integrated image in a join form

With an error:

collective-z3cform-norobots: with an error

Voir aussi
PloneConf 2017 à Barcelone PloneConf 2017 à Barcelone 27/10/2017

Retours sur la PloneConf 2017 à Barcelone.

PloneConf 2016, un vent nouveau sur Plone PloneConf 2016, un vent nouveau sur Plone 02/11/2016

Résumé de la conférence annuelle sur Plone qui s'est tenue à Boston.

Turning hackability into a use case 27/01/2015

When a CMS does not allow happy hacking anymore, it loses a very valid use case.

Plone Unified Installer and ZcxOracleDA 02/12/2010

Trying to setup cx_Oracle and ZcxOracleDA on a Plone/Zope Zeo setup using the Unified Installer ...

Connecting to Oracle with SQLAchemy and very simple Plone integration 11/06/2009

SQLAlchemy (The Python SQL Toolkit and Object Relational Mapper) allow Oracle connection through ...