Ordered queries are not ordered
-------------------------------
Key: CMIS-159
URL: https://issues.apache.org/jira/browse/CMIS-159
Project: Chemistry
Issue Type: Bug
Components: cmislib
Reporter: Stefane Fermigier
Assignee: Jeff Potts
When running an ordered SELECT query, the results are not ordered.
I believe the following patch is needed:
{noformat}
Index: model.py
===================================================================
--- model.py (revision 923205)
+++ model.py (working copy)
@@ -1337,11 +1337,11 @@
def __iter__(self):
''' Iterator for the result set '''
- return self.getResults().itervalues()
+ return iter(self.getResults())
def __getitem__(self, index):
''' Getter for the result set '''
- return self.getResults().values()[index]
+ return self.getResults()[index]
def __len__(self):
''' Len method for the result set '''
@@ -1411,12 +1411,13 @@
if self._xmlDoc:
entryElements = self._xmlDoc.getElementsByTagNameNS(ATOM_NS,
'entry')
- entries = {}
+ entries = []
for entryElement in entryElements:
cmisObject = getSpecializedObject(CmisObject(self._cmisClient,
self._repository,
xmlDoc=entryElement))
- entries[cmisObject.getObjectId()] = cmisObject
+ entries.append(cmisObject)
self._results = entries
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.