yup. @expose('json') forces you to return a dict , when the jquery
autocomplete expects a list in json format.
On Sunday, February 17, 2013 6:32:59 AM UTC+8, Craig Small wrote:
>
> On Fri, Feb 15, 2013 at 11:47:24PM -0800, Neil Ablang wrote:
> > @expose()
> [...]
> > val = json.JSONEncoder().encode(statecounty)
> > return (val)
>
>
> > > @expose('json')
> > > def optionsStates(self,**kw):
> [...]
> > > return dict(term=statecounty)
> OK so #1 returns
> ['foo','bar']
> #2 returns
> {'term': ['foo', 'bar']}
>
> all JSONified up of course.
>
> So you are sending different things back for your two functions.
> I find it is best to have a function that works, no matter how evil and
> keep it as reference and then build my "real" function and compare the
> two.
>
> Also, firebug helps when tracking down that the jquery is asking for, or
> not.
>
> - Craig
>
> --
> Craig Small VK2XLZ http://enc.com.au/ csmall at : enc.com.au
> Debian GNU/Linux http://www.debian.org/ csmall at : debian.org
> GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5
>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.