﻿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
15953	Allow setting individual fields as 'unique' from the model Meta options	Julien Phalip	nobody	"I'm dealing with this case:

{{{#!python
class A(models.Model):
    blah = models.CharField(max_length=100)

    class Meta:
        abstract = True

class B(A):
    pass
}}}

... where `A` is in a separate app than `B` and is used in multiple different contexts. I need to have the `blah` field be unique for `B`, whereas it shouldn't necessarily be unique in every other context where it is used. The only way I've found so far is:

{{{#!python
class B(A):
    pass

B._meta.get_field('blah')._unique = True # Ugliness alert!
}}}

Is it envisageable to allow setting the `unique` flag for individual fields from the Meta options, in the same way as with `unique_together`? Something like this for example:

{{{#!python
class B(A):

    class Meta:
        unique = ('blah',)
}}}"	New feature	new	Database layer (models, ORM)	1.3	Normal				Unreviewed	0	0	0	0	0	
