mirror of
https://github.com/django/django.git
synced 2025-04-08 15:36:47 +00:00
magic-removal: Fixed uniqueness constraint on ContentType model.
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ecd7f948dc
commit
3a1cc65322
@ -22,13 +22,14 @@ class ContentTypeManager(models.Manager):
|
||||
class ContentType(models.Model):
|
||||
name = models.CharField(maxlength=100)
|
||||
app_label = models.CharField(maxlength=100)
|
||||
model = models.CharField(_('python model class name'), maxlength=100, unique=True)
|
||||
model = models.CharField(_('python model class name'), maxlength=100)
|
||||
objects = ContentTypeManager()
|
||||
class Meta:
|
||||
verbose_name = _('content type')
|
||||
verbose_name_plural = _('content types')
|
||||
db_table = 'django_content_type'
|
||||
ordering = ('name',)
|
||||
unique_together = (('app_label', 'model'),)
|
||||
|
||||
def __repr__(self):
|
||||
return self.name
|
||||
|
Loading…
x
Reference in New Issue
Block a user