Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Customizable error message for ``unique_together`` constraints
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
orokusaki  
View profile  
 More options Apr 11 2010, 10:15 pm
From: orokusaki <flashdesign...@gmail.com>
Date: Sun, 11 Apr 2010 19:15:06 -0700 (PDT)
Local: Sun, Apr 11 2010 10:15 pm
Subject: Customizable error message for ``unique_together`` constraints
The idea is basically to allow for the customization of the error
message that's raised during ``validate_unique()``.

Example Error:
Widget with this Account and Name already exists.

More Useful Error:
You already have a Widget with this Name.

(The only key difference is that if a field is hidden like "Account",
I don't necessarily want the client to see it.)

The only idea I have for a solution is:

    class Meta:
        unique_together = (('account', 'name', 'You already have a
Widget with this Name.'),)

orokusaki


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Russell Keith-Magee  
View profile  
 More options Apr 11 2010, 11:10 pm
From: Russell Keith-Magee <freakboy3...@gmail.com>
Date: Mon, 12 Apr 2010 11:10:47 +0800
Local: Sun, Apr 11 2010 11:10 pm
Subject: Re: Customizable error message for ``unique_together`` constraints

This really isn't the best time to be proposing new features. We're a
handful of tickets away from the 1.2 final release, so the focus of
the core team is on finishing what we've started, rather than starting
something new.

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.

Yours,
Russ Magee %-)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karen Tracey  
View profile  
 More options Apr 12 2010, 7:38 am
From: Karen Tracey <kmtra...@gmail.com>
Date: Mon, 12 Apr 2010 07:38:51 -0400
Local: Mon, Apr 12 2010 7:38 am
Subject: Re: Customizable error message for ``unique_together`` constraints

On Sun, Apr 11, 2010 at 11:10 PM, Russell Keith-Magee <

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 only
seems to consider the former, but it would not make sense to add support for
that without also doing the unique_together case.

Karen


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
orokusaki  
View profile  
 More options Apr 12 2010, 1:03 pm
From: orokusaki <flashdesign...@gmail.com>
Date: Mon, 12 Apr 2010 10:03:11 -0700 (PDT)
Local: Mon, Apr 12 2010 1:03 pm
Subject: Re: Customizable error message for ``unique_together`` constraints
Thanks for the replies guys. I'll follow the progress of that ticket.

On Apr 12, 5:38 am, Karen Tracey <kmtra...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Patrick McNerthney  
View profile  
 More options Apr 12 2010, 1:34 pm
From: "Patrick McNerthney" <pmcnerth...@clearpointmetrics.com>
Date: Mon, 12 Apr 2010 07:34:48 -1000
Local: Mon, Apr 12 2010 1:34 pm
Subject: Re: Customizable error message for ``unique_together`` constraints

orokusaki <flashdesign...@gmail.com> wrote:

Thanks for the replies guys. I'll follow the progress of that ticket.

On Apr 12, 5:38 am, Karen Tracey <kmtra...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to
django-developers+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »