cannot __getitem__ from DB reply list

Discussion in 'Python' started by Konstantinos Pachopoulos, Sep 20, 2007.

  1. 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@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?
     
    Konstantinos Pachopoulos, Sep 20, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vizlab

    Cannot reply message

    vizlab, Dec 14, 2004, in forum: Java
    Replies:
    1
    Views:
    425
    Chris Smith
    Dec 14, 2004
  2. KanZen

    __getitem__ and arguments

    KanZen, Jul 19, 2003, in forum: Python
    Replies:
    4
    Views:
    979
    Ben Finney
    Jul 19, 2003
  3. Karl Chen
    Replies:
    0
    Views:
    438
    Karl Chen
    Jun 25, 2004
  4. Steven Bethard

    unittest.TestCase, lambda and __getitem__

    Steven Bethard, Sep 13, 2004, in forum: Python
    Replies:
    7
    Views:
    602
    Alex Martelli
    Sep 14, 2004
  5. It's me
    Replies:
    0
    Views:
    370
    It's me
    Feb 22, 2005
  6. dackz
    Replies:
    0
    Views:
    618
    dackz
    Feb 6, 2007
  7. davidj411
    Replies:
    1
    Views:
    1,337
    Mike Driscoll
    May 27, 2008
  8. Replies:
    2
    Views:
    792
Loading...