Implement DocumentProperties.__unicode__

This commit is contained in:
Will Thompson 2016-02-29 15:03:09 +00:00
parent 4613005b83
commit 8c23bdff6d

View file

@ -206,7 +206,7 @@ class Entity(models.Model):
ids.append(key['id']) ids.append(key['id'])
save('name', u'\n'.join([self.name] + list(self.alternativeNames))) save('name', u'\n'.join([self.name] + list(self.alternativeNames)))
self.find.exclude(key__in=ids).delete() self.find.exclude(key__in=ids).delete()
def update_matches(self): def update_matches(self):
import annotation.models import annotation.models
import item.models import item.models
@ -263,6 +263,9 @@ class DocumentProperties(models.Model):
index = models.IntegerField(default=0) index = models.IntegerField(default=0)
def __unicode__(self):
return u"%r-%r" % (self.document, self.entity)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
super(DocumentProperties, self).save(*args, **kwargs) super(DocumentProperties, self).save(*args, **kwargs)