[web2py] Re: get json data from url and set as default value of the table field

2016-11-12 Thread 黄祥
just share, hope can help others *e.g.* *controllers/default.py* def test(): table = db.test if session.lat and session.lon: table.lat.default = session.lat table.lon.default = session.lon #import gluon.contrib.simplejson #import urllib #import json import requests url = 'http://maps.googleapis

[web2py] Re: Updating with Count

2016-11-12 Thread Anthony Smith
On Saturday, 12 November 2016 21:50:34 UTC+11, 黄祥 wrote: > > 'for the update to be automatic when changes are made to the 1st table' > perhaps you can use after_update or before_update callback > ref: > > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-re

[web2py] get json data from url and set as default value of the table field

2016-11-12 Thread 黄祥
i have a form that capture latitude and longitude, and from the latitude and longitude value, i want to capture the address info too. check on the stackoverflow it can achieved by access url : http://maps.googleapis.com/maps/api/geocode/json?latlng=lat,lon&sensor=true is it possible to get json d

Re: [web2py] Re: DAL with db2 on ISeries/OS400 table names converted to AUTH_0000x

2016-11-12 Thread António Ramos
great thank you and next time i promise to read the docs ;) António 2016-11-12 5:23 GMT+00:00 Massimo Di Pierro : > You can use > > auth.settings.update( > table_user_name='auth_user', > table_group_name='auth_group', > table_membership_name='auth_membership', > t

[web2py] Re: Updating with Count

2016-11-12 Thread 黄祥
'for the update to be automatic when changes are made to the 1st table' perhaps you can use after_update or before_update callback ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update best regards, stifan -- Resources: -

[web2py] Re: How to translate dynamic data with web2py

2016-11-12 Thread Marko Seppälä
Thanks Leanel, I'll try your approaches. Especially second approach looks great! Any idea why that kind of solution isn't part of standard web2py and documented in web2py book? lauantai 5. marraskuuta 2016 19.56.03 UTC+2 Leonel Câmara kirjoitti: > > https://groups.google.com/forum/#!topic/web2p