forked from 0x2620/pandora
Entity.json: get document ids from join table
This is a bit quicker because it's just a lookup in a single table, not a join.
This commit is contained in:
parent
400b6650a2
commit
aa0fbc9d4a
1 changed files with 2 additions and 2 deletions
|
@ -168,8 +168,8 @@ class Entity(models.Model):
|
||||||
elif key == 'sortName':
|
elif key == 'sortName':
|
||||||
response[key] = self.name_sort
|
response[key] = self.name_sort
|
||||||
elif key == 'documents':
|
elif key == 'documents':
|
||||||
response[key] = [ox.toAZ(d['id'])
|
response[key] = [ox.toAZ(id_)
|
||||||
for d in self.documents.all().values('id').order_by('documentproperties__index')]
|
for id_, in self.documentproperties.order_by('index').values_list('document_id')]
|
||||||
elif key in self.data:
|
elif key in self.data:
|
||||||
response[key] = self.data[key]
|
response[key] = self.data[key]
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue