CHange unique constrain

This commit is contained in:
Valentin Samir 2015-05-23 19:32:02 +02:00
parent f4935711cf
commit f9ccd6e540
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cas_server', '0010_auto_20150518_2139'),
]
operations = [
migrations.AlterUniqueTogether(
name='replaceattributname',
unique_together=set([('name', 'replace', 'service_pattern')]),
),
]

View File

@ -132,7 +132,7 @@ class Usernames(models.Model):
class ReplaceAttributName(models.Model): class ReplaceAttributName(models.Model):
class Meta: class Meta:
unique_together = ('name', 'service_pattern') unique_together = ('name', 'replace', 'service_pattern')
name = models.CharField(max_length=255, help_text=u"nom d'un attributs à transmettre au service") name = models.CharField(max_length=255, help_text=u"nom d'un attributs à transmettre au service")
replace = models.CharField(max_length=255, blank=True, help_text=u"nom sous lequel l'attribut sera présenté au service. vide = inchangé") replace = models.CharField(max_length=255, blank=True, help_text=u"nom sous lequel l'attribut sera présenté au service. vide = inchangé")
service_pattern = models.ForeignKey(ServicePattern, related_name="attributs") service_pattern = models.ForeignKey(ServicePattern, related_name="attributs")