cannot __getitem__ from DB reply list

Konstantinos Pachopoulos kostaspaxos at yahoo.gr
Thu Sep 20 03:12:43 EDT 2007


Hi,
i have the following function:
################################
    def getGNUPlotInputFeaturesVersion(self):
        s=""
        bugCommits=0
        trdocCommits=0
        featCommits=0
        ct=CommitType()

        for version in self.releaseVersionsList_:
            self.execQuery("SELECT 
msg,prssedDevsFileNum,prssedMakesFileNum,prssedDocsFileNum,prssedGraphsFileNum 
FROM Commit WHERE \
                                                    
projVersion=\""+version+"\";");
            for tuple in self.dbcursor_.fetchall():
                print tuple
################################
On the "print tuple" part, i get:

kostas at sqo-oss:~/workspace/SVNLog2DB$ jython 2LaunchQueries.py
Connection established to  database...
Traceback (innermost last):
  File "2LaunchQueries.py", line 5, in ?
  File "/home/kostas/workspace/SVNLog2DB/QueryExecutor.py", line 80, in 
getGNUPlotInputFeaturesVersion
AttributeError: __getitem__


As far as i have read, this means, that there is a problem getting 
something from the list, because it  might be FOR EXAMPLE , that 
"self.dbcursor_.fetchall()" doesn't return a list -i know it does. 
However, i did a "print self.dbcursor_.fetchall()" and i got a huge list 
of tuples...

Why can't i iterate the list? Any advice?



More information about the Python-list mailing list