Thanks Guys, I will test out your suggestions shortly. I did actually specify 'unique=True' on my model but didn't know what to with the generated exception: IntegrityError: (1062, "Duplicate entry .... (I've only been doing TG for about a week!) I'll look it up some more and request if I need more help.
Thanks guys, Gareth On 5 Apr, 13:12, Jorge Godoy <[EMAIL PROTECTED]> wrote: > "gareth.doutch" <[EMAIL PROTECTED]> writes: > > How do I create a validator that can check an input value against > > currently stored values to ensure that duplicate entries do not occur? > > I saw a discussion on this previously, but it went off the list. > > You can use a validator, but I'd use a UNIQUE constraint on the database and > catch the exception. It is easier and would require less code. You can then > fill tg_errors with adequate values and let the widget system work showing the > error messages as usual. > > -- > Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

