add missing unique_together on graph descriptions

This commit is contained in:
Laura Klünder 2017-12-19 01:59:54 +01:00
parent 153c20410c
commit fe7faaff58
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-19 00:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mapdata', '0062_typos'),
]
operations = [
migrations.AlterUniqueTogether(
name='crossdescription',
unique_together=set([('space', 'origin_space', 'target_space')]),
),
migrations.AlterUniqueTogether(
name='leavedescription',
unique_together=set([('space', 'target_space')]),
),
]

View file

@ -256,6 +256,9 @@ class LeaveDescription(models.Model):
verbose_name = _('Leave description')
verbose_name_plural = _('Leave descriptions')
default_related_name = 'leave_descriptions'
unique_together = (
('space', 'target_space')
)
@cached_property
def title(self):
@ -277,6 +280,9 @@ class CrossDescription(models.Model):
verbose_name = _('Cross description')
verbose_name_plural = _('Cross descriptions')
default_related_name = 'cross_descriptions'
unique_together = (
('space', 'origin_space', 'target_space')
)
@cached_property
def title(self):