Adding unique restriction for epics
parent
bf9aafaca3
commit
3648043f37
|
@ -0,0 +1,19 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.9.2 on 2016-09-01 10:21
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('epics', '0002_epic_color'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterUniqueTogether(
|
||||||
|
name='relateduserstory',
|
||||||
|
unique_together=set([('user_story', 'epic')]),
|
||||||
|
),
|
||||||
|
]
|
|
@ -103,6 +103,7 @@ class RelatedUserStory(models.Model):
|
||||||
verbose_name = "related user story"
|
verbose_name = "related user story"
|
||||||
verbose_name_plural = "related user stories"
|
verbose_name_plural = "related user stories"
|
||||||
ordering = ["user_story", "order", "id"]
|
ordering = ["user_story", "order", "id"]
|
||||||
|
unique_together = (("user_story", "epic"), )
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{0} - {1}".format(self.epic_id, self.user_story_id)
|
return "{0} - {1}".format(self.epic_id, self.user_story_id)
|
||||||
|
|
Loading…
Reference in New Issue