| Issue 9: | allow errors from constraints with others() to refer to named fields in the error message | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Example
constraint:
- type: AllOrNone
name: foo
others: [bar, baz]
Would like the error message to be able to change depending on whether it's
the bar or baz or both fields that were missing.
Would like the error message to be able to refer to the fields label or
other 'friendly' name, rather than the field's name attribute.
Suspect the only satisfactory was of dealing with this might be to allow
providing a code-ref to generate the error message.
|
|
,
Aug 17, 2008
If there's a solution, can it be generalised to all the constraints properties?
Eg:
- type: Length
min: 2
max: 50
message: Must be at least 2 and no more than 50 characters long
It would be nice not to have to change the error message because the constraint
limits changed.
|
|
|
|