From 9fd107453962a65fd3dc9c9640d062384ed1cca4 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Sun, 24 Jun 2018 10:34:58 +0900 Subject: [PATCH] Add unique constraints to Label model --- doccano/app/db.sqlite3 | Bin 217088 -> 233472 bytes doccano/app/server/models.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doccano/app/db.sqlite3 b/doccano/app/db.sqlite3 index e2b792d2446c391c2335bf7322e8f7cc62f253a3..b10ab9092be17bffbb5872ecb4cf9a9751ec96e3 100644 GIT binary patch delta 1464 zcmbu9YiJx*6vyvl=eduwt%OOaG24XIMjB^k^VmFEQERO=uZDI%NWpzhk}Z==*i4Ga zhdx2@ov`3QX`rC3A4G})Xat7I5PBAuOaopi!5yN#|yN7^tG-8^VBy4n&QF~jUl^z<5?PnqqVrjc0c zdGuSViSQdJ@HwR57<>=A;X`Nw8|#G?$h;M2t^;Eaa=8xwzE0QmP0|> zq_B$P=^3^U71k_5+NLw*!qG~>!e_74tE_(+ZX$R9f5UxPgvyA}q$*1Q~QDt=X-Ze;ap( zOJmu|;+&r$ux<&ganajhy%NcgKlN52h=8tAcrtP<{9`B`{91lLXsGW=zpEqCLAok! z6_>?9X3LDA>r_3p?L|q8$MNY|?}&vP@#DT^-lBzj_d zB=&0`5R)&7T7SI!Ww3txCYlnpQBQLJ#;K;-{j^ydb*m91SB5=ujfmmcNzsM$VAkBs^T1Kf}@)q3Es3!A0`%r&5?tJBlh&jJyuV74U(}bK)8lr~)^| ziK|n916Sb0F`onHa^e~l*Z|Jv#Ibk-xKU1=hQa5JOmO1j3e*DU@Z#))nRPK!THr5O zhaccJdmxu#pFjcUWxh^Hd@Zoo0@xM!Y6ti_O8GiL0u&Ud`r2+FxB)Bh2m2fP|CgOd za2~F}GJFGf;2vCr>#Vc4;jltA>`Nu9v;kLjl4M$kxkw^+xI#jRHsTF=0zBBzhVl!l L!T^mcwW9n31&WdQ delta 443 zcmZozz}K*VcY?IwE(Qh$Qy_+cu!%axjJq}_Ea7M7=dqm3E+D^IQ9+nzv!%>AW>F^o zm;9XkyZJ-;>-eYgU*WgqU(OGdH+ai8nN#18F>A85zP=5AAA<;IacWUnYEgVjesXDU zYF-HsH?urvVrfZ6d?`?de>>1NcAy#o9%fZWsM4Ioq|}_r%k(1|`I`*3889*$=mS;p zGFLG$SMi7P9pe4QtINa6ZOGNdagSp)`&PCB)&!>YjOt9{d`}tL`0g?!O`K@DJvD*x z8{>5DIZPoee217eP7j>MWInxXF4KhVRmqIc7+IQl&Dgi6q%zLgwJm_DpMQG4K9i?L zW=>{FWf~6?D}y*cqi=p*YGp2y5F;ytDnF-xQF>xtW>sQIW`17&G6N#TCdNyxCB|n0`&ad|dzl diff --git a/doccano/app/server/models.py b/doccano/app/server/models.py index 4f74b858..a05c947a 100644 --- a/doccano/app/server/models.py +++ b/doccano/app/server/models.py @@ -14,8 +14,8 @@ class Project(models.Model): class Label(models.Model): - text = models.CharField(max_length=100) - shortcut = models.CharField(max_length=10) + text = models.CharField(max_length=100, unique=True) + shortcut = models.CharField(max_length=10, unique=True) project = models.ForeignKey(Project, on_delete=models.CASCADE, null=True) def as_dict(self):