Browse Source

Add unique constraints to Label model

pull/10/head
Hironsan 6 years ago
parent
commit
9fd1074539
2 changed files with 2 additions and 2 deletions
  1. BIN
      doccano/app/db.sqlite3
  2. 4
      doccano/app/server/models.py

BIN
doccano/app/db.sqlite3

4
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):

Loading…
Cancel
Save