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:
> db_table = u'backend'
> ordering = ('name',)
>
> In the admin, when I try to add a new object with a name which is
> already present, the unique=True constraint doesn't work as expected,
> the error is:
>
> IntegrityError at /admin/models_app/backend/add/
> duplicate key value violates unique constraint "backend_name_key"
>
>
> Basically, it seems the admin site doesn't handle unique
> constraints...do you have suggestions?
>
In old admin these sorts of constraints were handled by the oldforms
manipulator framework, which did validation. In newforms this validation is
still a work-in-progress, see ticket 6845:
http://code.djangoproject.com/ticket/6845
I'm assuming (someone please correct me if I'm wrong) when newforms-admin
gets merged to trunk and this ticket gets integrated, issues like this will
be handled more elegantly like they were in the old admin. But I haven't
actually had time to experiment at all with the new validation stuff yet.
Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---