Skip to content

Commit

Permalink
Merge pull request #612 from c2corg/image-date-sorting
Browse files Browse the repository at this point in the history
Image sorting by date_time
  • Loading branch information
dkocich authored Jan 27, 2017
2 parents 9f97ed5 + c5841ec commit 528c052
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c2corg_api/views/document_associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
image_documents_config, article_documents_config, area_documents_config, \
outing_documents_config, book_documents_config, xreport_documents_config
from c2corg_api.views.validation import updatable_associations
from sqlalchemy.sql.expression import or_, and_
from sqlalchemy.sql.expression import or_, and_, asc

associations_to_include = {
WAYPOINT_TYPE: {
Expand Down Expand Up @@ -180,6 +180,7 @@ def get_linked_images(document, lang):
Association.child_document_id == Image.document_id,
Association.parent_document_id == document.document_id)
).
order_by(asc(Image.date_time)).
group_by(Image.document_id).
all())

Expand Down

0 comments on commit 528c052

Please sign in to comment.