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. Advertising

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. KanZen

    __getitem__ and arguments

    KanZen, Jul 19, 2003, in forum: Python
    Replies:
    4
    Views:
    763
    Ben Finney
    Jul 19, 2003
  2. Andrew Bennetts

    Re: __getitem__ and classmethod/staticmethod

    Andrew Bennetts, Jun 25, 2004, in forum: Python
    Replies:
    0
    Views:
    484
    Andrew Bennetts
    Jun 25, 2004
  3. dackz
    Replies:
    0
    Views:
    493
    dackz
    Feb 6, 2007
  4. davidj411
    Replies:
    1
    Views:
    1,067
    Mike Driscoll
    May 27, 2008
  5. Replies:
    2
    Views:
    573
Loading...

Share This Page