[Django] #16192: Make unique_together error messages in ModelForms customizable

26 views
Skip to first unread message

Django

unread,
Jun 9, 2011, 10:06:02 AM6/9/11
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------+----------------------------
Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Forms
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------+----------------------------
This is related to ticket #8913 and Google groups discussion:
http://groups.google.com/group/django-
developers/browse_thread/thread/6306fea94a537c3b

Allow developers to specify a unique_together custom error_message on
their model. This is more difficult than #8913 since the syntax is less
obvious. Should there be something in the Meta?

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

Django

unread,
Jun 9, 2011, 5:33:08 PM6/9/11
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
---------------------------------------+------------------------
Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Milestone: | Component: Forms
Version: 1.3 | Severity: Normal
Resolution: | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
Changes (by aaugustin):

* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


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

Django

unread,
Jun 9, 2011, 5:33:23 PM6/9/11
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
leahculver | Status: new
Type: New | Component: Database layer
feature | (models, ORM)
Milestone: | Severity: Normal
Version: 1.3 | Keywords:
Resolution: | Has patch: 0
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* component: Forms => Database layer (models, ORM)


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

Django

unread,
Jan 22, 2012, 4:00:24 AM1/22/12
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------
Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.3
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Marboni):

Are you guys plan to fix it in 1.4?

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

Django

unread,
Jan 22, 2012, 5:01:17 AM1/22/12
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------
Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.3
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

This ticket hasn't gotten much attention. Apparently, no one cares enough
to write a patch. Until someone does, the feature won't be implemented.

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

Django

unread,
Nov 30, 2012, 4:10:09 PM11/30/12
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.3
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

I think it should get the attention it deserves. Providing the checking of
the fields without allowing to use a proper error message is like buying a
car which an alarm but without a door.

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

Django

unread,
Feb 3, 2014, 10:59:22 AM2/3/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.3
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by glynjackson):

More attention please! Are there any plans for this yet? I'm not confident
enough yet to submit a patch but would like to work on this with someone.

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:6>

Django

unread,
Feb 3, 2014, 10:59:50 AM2/3/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: 1.6

(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by glynjackson):

* version: 1.3 => 1.6


--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:7>

Django

unread,
Feb 3, 2014, 1:43:18 PM2/3/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master

(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0

Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by loic84):

* cc: loic@… (added)
* has_patch: 0 => 1
* version: 1.6 => master


Comment:

@glynjackson, I've had a go at this, could you please check if it solves
your issue?

https://github.com/django/django/pull/2235

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:8>

Django

unread,
Feb 4, 2014, 6:31:32 AM2/4/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 1

Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_docs: 0 => 1


Comment:

Looks reasonable to me, but needs documentation.

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:9>

Django

unread,
Feb 4, 2014, 8:52:48 AM2/4/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 1
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by loic84):

@timo what kind of documentation do you have in mind? Just an entry in the
release notes?

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:10>

Django

unread,
Feb 5, 2014, 12:55:58 AM2/5/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------

Reporter: leahculver | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0

Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by loic84):

* needs_docs: 1 => 0


Comment:

Added documentation to the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:11>

Django

unread,
Feb 8, 2014, 5:00:34 AM2/8/14
to django-...@googlegroups.com
#16192: Make unique_together error messages in ModelForms customizable
-------------------------------------+-------------------------------------
Reporter: leahculver | Owner: nobody
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"8847a0c601e4261823b1726b2db73eec2ac17940"]:
{{{
#!CommitTicketReference repository=""
revision="8847a0c601e4261823b1726b2db73eec2ac17940"
Fixed #16192 -- Made unique error messages in ModelForm customizable.

Overriding the error messages now works for both unique fields,
unique_together
and unique_for_date.

This patch changed the overriding logic to allow customizing
NON_FIELD_ERRORS
since previously only fields' errors were customizable.

Refs #20199.

Thanks leahculver for the suggestion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/16192#comment:12>

Reply all
Reply to author
Forward
0 new messages