[Zope3-dev] WidgetInputError and support for multiple errors
Garrett Smith
garrett at mojave-corp.com
Mon Sep 27 17:34:12 EDT 2004
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.
>> I'd like to change WidgetInputError to:
>>
>> 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 WidgetInputError(UserError):
>> def __init__(self, widget, message, original=None):
>> self.widget = widget self.message = message
>> self.original = original
>>
>> The doc() method would be deprecated.
>
> Yeah. Is it used for anything?
It's used by the error view to display the error message -- this would
be replaced by the 'message' attribute above.
--Garrett
More information about the Zope3-dev
mailing list