enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
i'm using pyramid with akhet according to the docs, i should be able to do something like this: @view_config(renderer='json') def login_status(self): rval= [1,2,4] return rval That creates an error for me: ValueError: Could not convert view return value [1, 2, 4]

Re: enabling json under akhet ?

2011-12-04 Thread John Anderson
You should return a dictionary not a list. rval = {'values': [1,2,4]} On Sun, Dec 4, 2011 at 5:34 PM, Jonathan Vanasco jonat...@findmeon.comwrote: i'm using pyramid with akhet according to the docs, i should be able to do something like this: @view_config(renderer='json') def

Re: enabling json under akhet ?

2011-12-04 Thread Chris McDonough
I don't think that's it (Pyramid will serialize a list just fine). But I don't have any other theory. - C On Sun, 2011-12-04 at 18:08 -0600, John Anderson wrote: You should return a dictionary not a list. rval = {'values': [1,2,4]} On Sun, Dec 4, 2011 at 5:34 PM, Jonathan Vanasco

Re: enabling json under akhet ?

2011-12-04 Thread Mike Orr
On Sun, Dec 4, 2011 at 3:34 PM, Jonathan Vanasco jonat...@findmeon.com wrote: i'm using pyramid with akhet according to the docs, i should be able to do something like this:    @view_config(renderer='json')    def login_status(self):        rval= [1,2,4]        return rval That creates

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
dicts and lists don't work. i posted a list to the group, because its the simplest object. On Dec 4, 7:08 pm, John Anderson son...@gmail.com wrote: You should  return a dictionary not a list. rval = {'values': [1,2,4]} On Sun, Dec 4, 2011 at 5:34 PM, Jonathan Vanasco

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
so you sort of solved this. you at least pointed me in the right direction to experiment! works: @action(renderer='json') doesn't work: @view_config(renderer='json') On Dec 4, 8:11 pm, Mike Orr sluggos...@gmail.com wrote: I don't think so, but akhet does use pyramid_handlers, so

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
On Dec 4, 8:11 pm, Mike Orr sluggos...@gmail.com wrote: By the way, I'm working on Akhet 2 which will not have an application scaffold, but expanded docs instead. So the days of the 'akhet' scaffold are numbered. Sigh. I do like the scaffold. It's mostly going to be replaced with

Re: enabling json under akhet ?

2011-12-04 Thread Mike Orr
On Sun, Dec 4, 2011 at 5:25 PM, Jonathan Vanasco jonat...@findmeon.com wrote: Is akhet2 on your bitbucket ?  i've been planning on making a sample application that is mostly docs/reference of different ways to do things in pyramid - i'm trying to teach a few former colleagues it, and it would