Changes between Initial Version and Version 1 of Ticket #16986, comment 1


Ignore:
Timestamp:
Oct 5, 2011, 11:57:36 AM (13 years ago)
Author:
Carl Meyer

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16986, comment 1

    initial v1  
    33I'd call this a new feature rather than a bug, since it's never been documented anywhere that you can raise a dict-style `ValidationError` from `clean` to get errors associated with particular fields. That said, it's a useful feature and one that I've wanted before, and the implementation is trivial and non-invasive.
    44
    5 Rather than spreading the `hasattr(..., "message_dict") disease outside `ValidationError`, I think the patch should introduce a new `has_dict` property on `ValidationError` that keeps that check internal to the implementation (and may as well clean up the internal `hasattr` uses to use the new property too).
     5Rather than spreading the `hasattr(..., "message_dict")` disease outside `ValidationError`, I think the patch should introduce a new `has_dict` property on `ValidationError` that keeps that check internal to the implementation (and may as well clean up the internal `hasattr` uses to use the new property too).
    66
    77Also, a note should be added to the docs that this is possible, and showing how its done. And we need a new test demonstrating that it works.
Back to Top