diff --git a/pandora/entity/models.py b/pandora/entity/models.py index 2f70dea62..40a343caa 100644 --- a/pandora/entity/models.py +++ b/pandora/entity/models.py @@ -174,7 +174,7 @@ class Entity(models.Model): response[key] = self.name_sort elif key == 'documents': response[key] = [ox.toAZ(id_) - for id_, in self.documentproperties.order_by('index').values_list('document_id')] + for id_, in self.documentproperties.order_by('document__name_sort').values_list('document_id')] elif key in self.data: response[key] = self.data[key] return response