Skip to content

Commit

Permalink
Sort on getObjPositionInParent when listing children.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasgraf committed May 21, 2016
1 parent 9cc1caa commit e43a274
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/plone/restapi/serializer/atcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class SerializeFolderToJson(SerializeToJson):

def _build_query(self):
path = '/'.join(self.context.getPhysicalPath())
query = {'path': {'depth': 1, 'query': path}}
query = {'path': {'depth': 1, 'query': path,
'sort_on': 'getObjPositionInParent'}}
return query

def __call__(self):
Expand Down
3 changes: 2 additions & 1 deletion src/plone/restapi/serializer/dxcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ class SerializeFolderToJson(SerializeToJson):

def _build_query(self):
path = '/'.join(self.context.getPhysicalPath())
query = {'path': {'depth': 1, 'query': path}}
query = {'path': {'depth': 1, 'query': path,
'sort_on': 'getObjPositionInParent'}}
return query

def __call__(self):
Expand Down
3 changes: 2 additions & 1 deletion src/plone/restapi/serializer/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def __init__(self, context, request):

def _build_query(self):
path = '/'.join(self.context.getPhysicalPath())
query = {'path': {'depth': 1, 'query': path}}
query = {'path': {'depth': 1, 'query': path},
'sort_on': 'getObjPositionInParent'}
return query

def __call__(self):
Expand Down

0 comments on commit e43a274

Please sign in to comment.