It is a mistake made my me I dont know how did I miss it, very bad.

dataTypeList[row.number_indicator] = dataTypeList[row.data]

it should be 

dataTypeList[row.number_indicator] = row.data


On Sunday, June 16, 2013 1:21:15 PM UTC+5:30, Jayakumar Bellie wrote:
>
> I have to create a has table like
> { '1':'data1', '2':'data2', '10':'data3', '50':'data4' }
>
> I get the data from the database, here is the code where I format the data
>
> 1        dataTypeList = {}
> 2        for row in result:
> 3           dataTypeList[row.number_indicator] = dataTypeList[row.data]
>
> I get KeyError: 1L error in line 3
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to