One way to get your 2nd option:
in controller:
def country_list():
countries = []
for rec in db(query).select(db.vtx_vertex.name, left=left, distinct=True,
orderby=db.vtx_vertex.name):
countries.append(rec.name)
return dict(suggestions = countries)
in the view (js), call the controller function above using .json
extension: https://mysite.com/country_list.json
Depending on your settings, you may need to add '*.json' to
response.generic_patterns if you have overridden those at any point.
HTH,
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/d4c177ac-c8f3-459e-9f66-d43856d769e6o%40googlegroups.com.