[Django] #23865: Document raising a `ValidationError` with a dictionary

17 views
Skip to first unread message

Django

unread,
Nov 18, 2014, 12:58:10 PM11/18/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------+--------------------
Reporter: alasdairnicol | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
Ticket #16986 allows you to report errors on individual fields by
instantiating a `ValidationError` with a dictionary. However, this
technique is an undocumented private API, and not mentioned in the
[https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.clean
Model.clean docs].

I started a [https://groups.google.com/forum/#!topic/django-
developers/6KGoVYeM3-Y thread on Django developers]

--
Ticket URL: <https://code.djangoproject.com/ticket/23865>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 19, 2014, 8:41:38 AM11/19/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------+--------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by alasdairnicol):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23865#comment:1>

Django

unread,
Nov 19, 2014, 1:12:51 PM11/19/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------+--------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by carljm):

Pull request is at https://github.com/django/django/pull/3573

--
Ticket URL: <https://code.djangoproject.com/ticket/23865#comment:2>

Django

unread,
Nov 20, 2014, 7:05:54 AM11/20/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Documentation | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by carljm):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Ready for checkin


Comment:

PR seems merge-ready to me. There's been some discussion on the ML thread;
I'll wait a bit for merge to see if Loic or Anssi or anyone else wants to
weigh in on the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/23865#comment:3>

Django

unread,
Nov 21, 2014, 1:02:00 PM11/21/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed

Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"5b26a014a81ba0d404d46e11d2b45c01d92b97e5"]:
{{{
#!CommitTicketReference repository=""
revision="5b26a014a81ba0d404d46e11d2b45c01d92b97e5"
Fixed #23865 -- documented how to assign errors to a field in
Model.clean()

Also added a unit test wit the simpler syntax which we have documented,
where the dictionary values are strings.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23865#comment:4>

Django

unread,
Nov 21, 2014, 1:03:12 PM11/21/14
to django-...@googlegroups.com
#23865: Document raising a `ValidationError` with a dictionary
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"f91c6ecc223dbed05f6640af515e8b56895170ac"]:
{{{
#!CommitTicketReference repository=""
revision="f91c6ecc223dbed05f6640af515e8b56895170ac"
[1.7.x] Fixed #23865 -- documented how to assign errors to a field in
Model.clean()

Also added a unit test wit the simpler syntax which we have documented,
where the dictionary values are strings.

Backport of 5b26a014a81ba0d404d46e11d2b45c01d92b97e5 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23865#comment:5>

Reply all
Reply to author
Forward
0 new messages