Re: admin doesn't catch IntegrityErrors?

2008-07-14 Thread Karen Tracey
On Mon, Jul 14, 2008 at 5:23 AM, Alex Rades <[EMAIL PROTECTED]> wrote: > > Hi, > I'm using latest newforms-admin and I have a simple model which is: > > class Backend(models.Model): >name = models.CharField(unique=True, max_length=255) >address = models.IPAddressField() > >class Meta:

Re: admin doesn't catch IntegrityErrors?

2008-07-14 Thread Alex Rades
My problem is specifically with the admin site Thanks On Mon, Jul 14, 2008 at 11:55 AM, rui <[EMAIL PROTECTED]> wrote: > I had to come around this doing in the start of the code: > > from django.db import transaction > > And after the IntegrityError is catched (with a try/except block): > >

Re: admin doesn't catch IntegrityErrors?

2008-07-14 Thread rui
I had to come around this doing in the start of the code: from django.db import transaction And after the IntegrityError is catched (with a try/except block): transaction.rollback() Like: try: user.save() except IntegrityError, e: transaction.rollback()

admin doesn't catch IntegrityErrors?

2008-07-14 Thread Alex Rades
Hi, I'm using latest newforms-admin and I have a simple model which is: class Backend(models.Model): name = models.CharField(unique=True, max_length=255) address = models.IPAddressField() class Meta: db_table = u'backend' ordering = ('name',) In the admin, when I