get entity by id after all

This commit is contained in:
j 2014-12-16 15:21:24 +00:00
parent 61bf668957
commit 15fb864d74

View file

@ -226,10 +226,10 @@ class Annotation(models.Model):
j['languages'] = self.languages.split(',')
l = self.get_layer()
if l['type'] == 'entity':
entity = Entity.get_by_name(self.value)
if entity > 0:
try:
entity = Entity.get(self.value)
j['entity'] = entity.json(user=user)
else:
except:
j['entity'] = {}
elif l['type'] == 'event':
qs = self.events.all()