On Mon, Apr 12, 2010 at 10:15 AM, orokusaki <flashdesign...@gmail.com> wrote: > 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.'),)
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.
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:
> > class Meta: > > unique_together = (('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 only seems to consider the former, but it would not make sense to add support for that without also doing the unique_together case.
> 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:
> > > class Meta: > > > unique_together = (('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 only > seems to consider the former, but it would not make sense to add support for > that without also doing the unique_together case.
> 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:
> > > class Meta: > > > unique_together = (('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 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 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.