I've noticed that error messages triggered by hidden fields (e.g. fields using a HiddenWidget) do not get displayed. I think the solution to this is for MappingWidget to get a custom handle_error method which will stick the messages from any hidden subfields into the mapping's error messages.
While looking into this, I noticed a second issue. Some parts of deform properly handle array-valued Invalid.msgs (see, e.g., mapping_item.pt, sequence_item.pt); other parts expect a scalar string value (e.g. mapping.pt).
I think that compound (array-valued) error messages should be allowed on any Invalid instance. To that end:
mapping.pt should be fixed to support compound error messages
Field.errormsg needs attention. My suggestion is that, in the case of compound error messages, it should return '\n'.join(msg). It should also probably be deprecated.
TextAreaCSVWidget.handle_error and TextInputCSVWidget.handle_error should put compound error messages in a array rather than concatenating them into a single string. (Also the example at the end of the handle_error part of the "Writing Your Own Widget" doc section should be updated.)
I'm willing to formulate this as a pull request, but I wanted to run it by you first to make sure that it all sounds reasonable.
I've noticed that error messages triggered by hidden fields (e.g. fields using a HiddenWidget) do not get displayed. I think the solution to this is for
MappingWidgetto get a customhandle_errormethod which will stick the messages from any hidden subfields into the mapping's error messages.While looking into this, I noticed a second issue. Some parts of
deformproperly handle array-valuedInvalid.msgs (see, e.g.,mapping_item.pt,sequence_item.pt); other parts expect a scalar string value (e.g.mapping.pt).I think that compound (array-valued) error messages should be allowed on any
Invalidinstance. To that end:mapping.ptshould be fixed to support compound error messagesField.errormsgneeds attention. My suggestion is that, in the case of compound error messages, it should return'\n'.join(msg). It should also probably be deprecated.TextAreaCSVWidget.handle_errorandTextInputCSVWidget.handle_errorshould put compound error messages in a array rather than concatenating them into a single string. (Also the example at the end of the handle_error part of the "Writing Your Own Widget" doc section should be updated.)I'm willing to formulate this as a pull request, but I wanted to run it by you first to make sure that it all sounds reasonable.