The location_data received from geoNames can contain more than one country 
code, your first sample has 3: MK DE US.
Your second sample has only one: MX

By the name of the variable being used (your_country) I assume you want to 
get only one postalcode.
In any case you could use:

location_data['postalcodes'][0]['countryCode']

which gives you the countryCode of the first entry (check if there is at 
least one before hand).

Denes

On Saturday, October 3, 2015 at 2:31:48 PM UTC-4, Alex Glaros wrote:
>
> Single item works Laer,
>
> your_country = (db.Country.countryCode == 
> location_data['postalcodes'][5]['countryCode'])
>
> how can all of the values be accessed? See my guess below:
>
> your_country = (db.Country.countryCode == location_data['postalcodes'][ALL
> ]['countryCode'])
>
> thanks,
>
> Alex
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to