Thank you everyone for the advice.
Chris
On Sep 11, 2011 4:47 AM, "pbreit" wrote:
> Good point.
Good point.
I do this.
auth.settings.extra_fields['auth_user'] =
[Field('city'),Field('country')]
def lola(form):
if form.vars.institution_country:
form.vars.longitude, form.vars.latitude = geocode("%s %s" %
(form.vars.city, form.vars.country))
auth.settings.register_onvalidation=lola
auth.sett
On Saturday, September 10, 2011 9:35:17 PM UTC-4, pbreit wrote:
>
> Maybe even a computed field?
> http://web2py.com/book/default/chapter/06#Computed-Fields
>
Yes, I suppose that's not a bad idea, though in this case, I guess that
would require calling the geocoding function twice -- once for the
Maybe even a computed field?
http://web2py.com/book/default/chapter/06#Computed-Fields
You might want to store the postcode and check it to see if the new one is
different before geocoding it.
On Saturday, September 10, 2011 6:51:51 PM UTC-4, leftcase wrote:
>
> Cool, Thanks Anthony!
>
> Does the onvalidation option have benefits over and above the way I've done
> it.
>
I guess it's a bit simpler because it still allows form.accepts() to handle
the DB insert, so you don't have to do it
Cool, Thanks Anthony!
Does the onvalidation option have benefits over and above the way I've done it?
Chris
> Another option might be using an onvalidation function:
> http://web2py.com/book/default/chapter/07#onvalidation
> Anthony
>
> On Saturday, September 10, 2011 4:37:08 PM UTC-4, leftcase
Another option might be using an onvalidation function:
http://web2py.com/book/default/chapter/07#onvalidation
Anthony
On Saturday, September 10, 2011 4:37:08 PM UTC-4, leftcase wrote:
>
> Hi there,
>
> I bought the web2py .pdf, and have been reading it, but I'm struggling
> a little bit with:
>
> Hi there,
>
> I bought the web2py .pdf, and have been reading it, but I'm struggling
> a little bit with:
>
> http://www.web2py.com/book/default/chapter/07#SQLFORM
>
> Specifically the section "SQLFORM without database IO"
>
> I have 2 fields, lon & lat I'd like to calculated from a postcode and
9 matches
Mail list logo