On Thu, Apr 22, 2010 at 2:45 PM, Radhikavk <radhi3...@gmail.com> wrote: > > i have defined the country field unique in database but when i try to insert > duplicate entry it throws an error , to handle that error i m asking
In your view: try: instance.save() except IntegrityError, e: return HttpResponse("I'm sorry, Dave. I'm afraid I can't do that") Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.