I have got the select function of mongodb adapter working, but know I
need to convert a pymongo cursor to row.
The point is the pymongo supports nested documents and that can be a
bit hard to convert for a parameter of the parse method.

Here is the select function a have ajusted, but this one won't work
with yours because I also altered a lot of other functions. But this
is to get the idea. The line that has to be changed is pointed to with
<--
    def select(self,query,fields,attributes):
        #if not isinstance(query,Query):
        #    raise SyntaxError, "Not Supported"
        definition = self._select(query,fields,attributes)

        ctable = self.connection[str(definition['tablename'])]
        if ((definition['sort'] == None) & (definition['skip'] ==
None)):
            result = ctable.find(definition['query'])
        elif((definition['sort'] != None) & (definition['skip'] ==
None)):
            result =
ctable.find(definition['query']).sort(definition['sort'])
        elif((definition['sort'] == None) & (definition['skip'] !=
None)):
            result =
ctable.find(definition['query']).skip(definition['skip'])
        elif((definition['sort'] != None) & (definition['skip'] !=
None)):
            result =
ctable.find(definition['query']).sort(definition['sort']).skip(definition['skip'])
        else:
            raise RuntimeError, "No valid query information found"
        print str(result)
        #rows = [cols['value'] for cols in result] <--- This line
converts the result to be parsed
        return self.parse(rows, definition['colnames'], False)

Anyone with advise on the matter or ideas?

Reply via email to