Message from discussion
Customizable error message for ``unique_together`` constraints
Received: by 10.101.14.11 with SMTP id r11mr1365226ani.47.1271091791887;
Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
Received: by 10.101.14.11 with SMTP id r11mr1365224ani.47.1271091791848;
Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
Return-Path: <flashdesign...@gmail.com>
Received: from mail-gx0-f193.google.com (mail-gx0-f193.google.com [209.85.217.193])
by gmr-mx.google.com with ESMTP id 12si399987gxk.2.2010.04.12.10.03.11;
Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
Received-SPF: pass (google.com: domain of flashdesign...@gmail.com designates 209.85.217.193 as permitted sender) client-ip=209.85.217.193;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of flashdesign...@gmail.com designates 209.85.217.193 as permitted sender) smtp.mail=flashdesign...@gmail.com
Received: by gxk9 with SMTP id 9so3628779gxk.7
for <django-developers@googlegroups.com>; Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
MIME-Version: 1.0
Received: by u21g2000yqc.googlegroups.com with HTTP; Mon, 12 Apr 2010 10:03:11
-0700 (PDT)
Date: Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
In-Reply-To: <h2kaf3536271004120438w2e7a16e2la1176cfd9872ab50@mail.gmail.com>
X-IP: 75.167.142.24
References: <d6a02366-bdf5-4917-ae0c-e97b3e27de6e@r27g2000yqn.googlegroups.com>
<t2r720ff77c1004112010lbdcc568bn10e242e6ed3000e6@mail.gmail.com>
<h2kaf3536271004120438w2e7a16e2la1176cfd9872ab50@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9)
Gecko/20100315 Firefox/3.5.9,gzip(gfe)
Received: by 10.150.247.5 with SMTP id u5mr150307ybh.25.1271091791793; Mon, 12
Apr 2010 10:03:11 -0700 (PDT)
Message-ID: <277c21ff-c98d-4738-affb-7027bde8d425@u21g2000yqc.googlegroups.com>
Subject: Re: Customizable error message for ``unique_together`` constraints
From: orokusaki <flashdesign...@gmail.com>
To: Django developers <django-developers@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Thanks for the replies guys. I'll follow the progress of that ticket.
On Apr 12, 5:38=A0am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sun, Apr 11, 2010 at 11:10 PM, Russell Keith-Magee <
>
>
>
> freakboy3...@gmail.com> wrote:
> > On Mon, Apr 12, 2010 at 10:15 AM, orokusaki <flashdesign...@gmail.com>
> > wrote:
>
> > > The only idea I have for a solution is:
>
> > > =A0 =A0class Meta:
> > > =A0 =A0 =A0 =A0unique_together =3D (('account', 'name', 'You already =
have a
> > > Widget with this Name.'),)
>
> > [snip]
>
> > That said - my initial reaction is that while I agree with the use
> > case, I'm not a huge fan of the syntax - There is not syntactic
> > separation between column names and error messages; while that isn't
> > necessarily syntactically ambiguous, it's certainly conceptually
> > ambiguous.
>
> Agreed on the objection to that proposed syntax.
>
> Just for reference, there is a ticket for customizable unique error
> messages, #8913. Whatever is eventually done here needs to consider both
> plain unique and unique_together messages -- the ticket at the moment onl=
y
> seems to consider the former, but it would not make sense to add support =
for
> that without also doing the unique_together case.
>
> Karen