I've found some strange behaviour with python, and I don't get why.
This is how I create items and lists:
def createItemJson(self,id,url):
ret={}
ret['id']=id
ret['url']=url
return ret
def createListJson(self,i):
ret_l = []
for i in range(0,i,1):
ret_l.append(self.createItemJson(i, i))
return ret_l
And this is the output of a list of 3 elements:
[{'url': 0, 'id': 0}, {'url': 1, 'id': 1}, {'url': 2, 'id': 2}]
If I take this string and I do in shell A:
for v in data
I can print the 3 objects. N.B.len(data) is 3.
Now I store this data in the db as textfield (is it correct?).
When I retrieve the object I get len with value 63.
Basically Django sees it as a string. What can I do? I tried to do json.load but it does not work.