#12881: Unique constraint error with model inheritance while ModelForm should not validate -------------------------------------------------------+-------------------- Reporter: fgaudin | Owner: nobody Status: new | Milestone: Component: Forms | Version: 1.1 Keywords: unique constraint, ModelForm, inheritance | Stage: Unreviewed Has_patch: 0 | -------------------------------------------------------+-------------------- The use case is :
* ParentClass has an attribute "name" with unique=True * FirstSubClass inherits ParentClass * SecondSubClass inherits ParentClass With a ModelForm for each subclass, I can't create two FirstSubClasses with the same name, neither two SecondSubClasses, the form doesn't validate, what is expected. But if I create a FirstSubClass instance and try to create a SecondSubClass instance, the form validate and unique constraint error is raised by postgres. A project showing the use case with unit tests is in attachment. -- Ticket URL: <http://code.djangoproject.com/ticket/12881> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.