Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > cannot __getitem__ from DB reply list

Reply
Thread Tools

cannot __getitem__ from DB reply list

 
 
Konstantinos Pachopoulos
Guest
Posts: n/a
 
      09-20-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,prssedDoc sFileNum,prssedGraphsFileNum
FROM Commit WHERE \

projVersion=\""+version+"\";");
for tuple in self.dbcursor_.fetchall():
print tuple
################################
On the "print tuple" part, i get:

kostas@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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does list.__getitem__ return a list instance for subclasses ofthe list type? dackz Python 0 02-06-2007 04:44 PM
Reply....Reply All not in Browser Denny B Computer Support 3 04-24-2006 01:59 PM
can sombody tell me how to reply to sombody elses message and include the original message in the reply? Computer Support 3 08-24-2003 12:58 PM
Re: can sombody tell me how to reply to sombody elses message and include the original message in the reply? Computer Support 0 07-24-2003 09:21 PM



Advertisments