diff --git a/edbob/pyramid/forms/simpleform.py b/edbob/pyramid/forms/simpleform.py index c1d9c51..0abcec4 100644 --- a/edbob/pyramid/forms/simpleform.py +++ b/edbob/pyramid/forms/simpleform.py @@ -26,15 +26,29 @@ ``edbob.pyramid.forms.simpleform`` -- pyramid_simpleform Forms """ -import pyramid_simpleform from pyramid.renderers import render + +import formencode +import pyramid_simpleform from pyramid_simpleform.renderers import FormRenderer from edbob.pyramid import helpers from edbob.pyramid.forms import Form -__all__ = ['SimpleForm'] +__all__ = ['Schema', 'SimpleForm'] + + +class Schema(formencode.Schema): + """ + Subclass of ``formencode.Schema``, which exists only to ignore extra + fields. These normally would cause a schema instance to be deemed invalid, + and pretty much *every* form has a submit button which would be considered + an extra field. + """ + + allow_extra_fields = True + filter_extra_fields = True class SimpleForm(Form):