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':
|
||||
response[key] = self.name_sort
|
||||
elif key == 'documents':
|
||||
response[key] = [ox.toAZ(d['id'])
|
||||
for d in self.documents.all().values('id').order_by('documentproperties__index')]
|
||||
response[key] = [ox.toAZ(id_)
|
||||
for id_, in self.documentproperties.order_by('index').values_list('document_id')]
|
||||
elif key in self.data:
|
||||
response[key] = self.data[key]
|
||||
return response
|
||||
|
|
Loading…
Reference in a new issue