summaryrefslogtreecommitdiff
path: root/archaeological_files/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2014-01-03 18:23:24 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2014-01-03 18:23:24 +0100
commitefe93aa7b9b499b368e9899f89b221d36436608c (patch)
tree6e9ef914d8050d4068a28ed6fbc96ee67c0e54cf /archaeological_files/models.py
parent6679eab987ec98b5006435424955936b6d256bb7 (diff)
downloadIshtar-efe93aa7b9b499b368e9899f89b221d36436608c.tar.bz2
Ishtar-efe93aa7b9b499b368e9899f89b221d36436608c.zip
Fix unique field on archaeological files
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r--archaeological_files/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 149948257..1c7be726c 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -68,7 +68,7 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter):
numeric_reference = models.IntegerField(_(u"Numeric reference"), blank=True,
null=True)
internal_reference = models.CharField(_(u"Internal reference"), blank=True,
- null=True, max_length=60, unique=True)
+ null=True, max_length=60)
name = models.CharField(_(u"Name"), max_length=100, blank=True, null=True)
file_type = models.ForeignKey(FileType, verbose_name=_(u"File type"))
in_charge = models.ForeignKey(Person, related_name='file_responsability',
@@ -122,6 +122,7 @@ class File(BaseHistorizedItem, OwnPerms, ValueGetter):
("delete_own_file", ugettext(u"Can delete own Archaelogical file")),
)
ordering = ['-year', '-numeric_reference']
+ unique_together = ("internal_reference", "year")
@property
def short_class_name(self):