[Zope3-dev] WidgetInputError and support for multiple errors

Jim Fulton jim at zope.com
Mon Sep 27 17:38:09 EDT 2004


Garrett Smith wrote:
> Jim Fulton wrote:
> 
>>errors
>>
>>
>>Garrett Smith wrote:
>>
>>>Jim Fulton wrote:
>>>
>>>
>>>
>>>>Garrett Smith wrote:
>>>>
>>>>
>>>>>It's not obvious to me why one would need support for multiple
>>>>>errors for a widget. Any input here?
>>>>
>>>>Multiple schema invariants involving a field are violated.
>>>>
>>>>(Are schema invariants checked today?)
>>>
>>>
>>>I dont believe so -- I haven't seen anything like that. The widget
>>>merely calls the field's validate method, which only raises a single
>>>error.
>>
>>But in the future we will.  We'll probably need to say that we only
>>check schema invariants of all of the field constraints are met.  I
>>could easily imagine multiple invariants involving the same field and
>>wanting to show the messages for them next to the field.
>>
>>Jim
> 
> 
> Okay -- so, you're okay with the following:
> 
>   class IWidgetInputError(Interface):
>     widget = Attribute("The widget the error is associated with.")
>     message = Attribute("An error message to display to the user.")
>     original = Attribute("An optional original error that caused
>                    the input error.")
> 
>   class IWidget(Interface):
>     ...
>     errors = Attribute("A list of errors generated by the last call to
>                  getInputValue.")
>     ...
> 

Yup

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list