I have the following list of tuples:
[(2010, u'S03', u'AA26FedGovAccounts', 1.90537034315564, 46385659904.0), (2010, u'S03', u'AA27StLocGovAccounts', 1.5897291595379, 58351759360.0), (2010, u'S03', u'AA28CapitalAccounts', 1.79050465110027, 95550709760.0)]
When I use: viewData[:][:] it works as expected and outputs all the data.
When I use: viewData[2][2] it works correctly and outputs 'AA28CapitalAccounts'.
The problem is that both viewData[2][:] and viewData[:][2] are giving me the same result of: (2010, u'S03', u'AA28CapitalAccounts', 1.79050465110027, 95550709760.0). I was expecting viewData[:][2] to give me a list of u'AA26FedGovAccounts', u'AA27StLocGovAccounts', and u'AA28CapitalAccounts'.
This is being run on a webserver using Django. The code is:
c = connections['default'].cursor()
c.execute("SELECT * FROM {0}.\"{1}\"".format(analysis_schema, viewName))
viewData=c.fetchall()
values = { curDesc[2][0] : str(viewData[:][2]) }
 
     
     
     
     
    