﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1751	unique_together does not work when any of the listed fields contains a FK	Olive	Gary Wilson	"An IntegrityError is raised when saving the following kind of object:

{{{
class DocTitle(models.Model):
    sequence    = models.IntegerField(_('sequence'))
    title_en    = models.CharField(_('title'),maxlength=200)
    
    def __repr__(self):
        return self.title_en
    
    class Meta:
        verbose_name = _('documentation title')
        verbose_name_plural = _('documentation titles')
        ordering = ['sequence']
        
    class Admin:
        list_display = ('title_en',)
             
class DocChunk(models.Model):
    application = models.ForeignKey(Application,edit_inline=True,num_in_admin=1)
    title       = models.ForeignKey(DocTitle)
    text        = models.TextField(_('text'),core=True)
    
    def __repr__(self):
        return self.title.title_en
    
    class Meta:
        verbose_name = _('Document chunk')
        verbose_name_plural = _('Document chunks')
        ordering = ['title']
        unique_together = ((""application"",""title""),)
}}}
"	defect	closed	contrib.admin	1.3	normal	fixed	fk unique_together	nslater@… gary.wilson@… cathy@… larlet@…	Accepted	0	0	0	0	0	0
