Your key is a tuple, which is ok in Python but not in JS, I think.

On Jan 17, 2011, at 11:41 AM, Lorin Rivers <lriv...@mosasaur.com> wrote:

> No doubt this is my base Python ignorance being the problem.
> 
> I've made some progress on my pivot problem, using this recipe 
> <http://code.activestate.com/recipes/334695-pivotcrosstabdenormalization-of-a-normalized-list/>
>  (actually, the improved one from the comments).
> 
> I'm getting what I want now (or close to it):
> [   {   'FreezeTime': datetime.datetime(2010, 12, 12, 21, 0),
>        ('S00000000',): 643.882600715039,
>        ('S00000001',): '',
>        ('S00000002',): 621.511925599709},
>    {   'FreezeTime': datetime.datetime(2010, 12, 12, 22, 0),
>        ('S00000000',): 159.230736027886,
>        ('S00000001',): '',
>        ('S00000002',): 166.628191452988}, ...
> ]
> 
> But when I try to convert it to json using this in my view:
> var optimizerdata = {{response.write(json(optimizers), escape=False)}};
> 
> Where optimizers is a list that looks like this:
> 
> It throws the error, saying this:
>  TypeError: key ('S00000001',) is not a string
> -- 
> Lorin Rivers
> Mosasaur: Killer Technical Marketing <http://www.mosasaur.com>
> <mailto:lriv...@mosasaur.com>
> 512/203.3198 (m)
> 
> 

Reply via email to