On 5 December 2013 18:21, Mike Dewhirst <mi...@dewhirst.com.au> wrote: > On 5/12/2013 3:04pm, Lachlan Musicman wrote: >> The model's clean(): >> >> pn = self.part_number() >> all_parts = Part.objects.all() >> for part in all_pns: >> if pn == part.part_number(): >> raise ValidationError('Part numbers must be unique. >> Part number %s already exists.' % part.part_number()) > > > What happens if clean() is called for an existing Part?
Stop. Brain hurt. > >> >> >> It's fairly straight forward. >> >> Ideally I would like to make the %s in the error message to an <a> >> link for reference value. > > > IMHO, "ideally" is a deadly whirlpool which sucks your life away without > measurable gain. I reckon you should aim for the most basic/simple/easy > mechanism. Then later on, if users can actually make a decent case for extra > information via a hyperlink you could add the extra feature. You are right - thanks for the tip. cheers L. -- >From this perspective it is natural that anarchism be marked by spontaneity, differentiation, and experimentation that it be marked by an expressed affinity with chaos, if chaos is understood to be what lies outside or beyond the dominant game or system. Because of the resistance to definition and categorisation, the anarchist principle has been variously interpreted as, rather than an articulated position, “a moral attitude, an emotional climate, or even a mood”. This mood hangs in dramatic tension between utopian hope or dystopian nihilism... ----- http://zuihitsu.org/godspeed-you-black-emperor-and-the-politics-of-chaos -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGBeqiMNN_Ou_vpOBmzhOg%2B2Fb%2BMoA26KETEQppDvKkKnbbtEA%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.