There are more settings to play around with and the book is not always up
to date with source code changes.
With that in mind I always check the source to see how it works when I am
having trouble.
The registration process and how it uses those settings is located in
gluon/tools.py around line
First, note that auth.settings.login_after_registration is for
*automatically* logging in the user immediately after registration. It is
False by default. However, having it set to False does not prevent the user
from manually logging in after registration (unless you require
verification
It appears to be a bug in the IS_DATE validator -- the code expects the
date object to have a tzinfo attribute, but only datetime and time objects
have that attribute.
More generally, it is not clear how one should apply transformations to
dates based on timezones. If you know the date in UTC
Yes ok but this is not what I want :
extracted from web2py book:
"
If you want to allow people to register and automatically log them in after
registration but still want to send an email for verification so that they
cannot login again after logout, unless they completed the instructions in
I'm developing an application that will have users from different time
zones. The intent is to store everything in UTC and translate to user's
timezone at display/edit time. I started working on my own solution when I
came across this post
hi, pierre,
might i know how do you get the latitude and longitude value for your
form.vars?
thanks and best regards,
stifan
On Monday, October 26, 2015 at 12:45:01 AM UTC+7, Pierre wrote:
>
> thanks this works :
>
> auth.settings.register_onvalidation(check_geo)
>
> +
>
> def
Seems I overlooked the obvious..!
Thanks DenesL :0)
--
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
You might try using the "rname" feature:
Field('state', rname='st')
or:
Field('state', rname='"state"')
web2py will use "state" as the name, but the database will see the name as
"st" (or in the second case, the name "state" is passed to the database,
but it is surrounded by double quotes,
thanks for the example, i test it and work, btw, when i try using another
example is not work (no error occured, but the result is not expected
(nothing happen) ).
e.g. taken from
http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation
my code
*controllers/defaut.py*
def test():
feel dumb asking about this subject again but what is correct way to get
the individual value?
here is what the data looks like
{{x=request.get_vars.x}}
this is X: {{=x}}
this is X:
{u'placeName': u'Novato', u'countryCode': u'US', u'lat': 38.061837,
u'postalcode': u'94949', u'lng':
FYI, we're going to remove the timezone option from IS_DATE (which doesn't
work anyway), so you're better off using a datetime field and setting the
time to midnight.
Anthony
On Sunday, October 25, 2015 at 12:02:48 PM UTC-4, Julian Sanchez wrote:
>
> Thanks Anthony, great insight.
>
> Most
thanks this works :
auth.settings.register_onvalidation(check_geo)
+
def check_geo(form):
if not form.vars.lat or not form.vars.lng:
redirect(url('registration_failed'))
Le dimanche 25 octobre 2015 13:34:36 UTC+1, Anthony a écrit :
>
> First, note that
It is not clear from the post if you want to cast a type at the database
level or the database level. If you want to do it at the web2py level your
choice is looping or map
map(lambda row: row.update(field=int(row.field)), rows)
If you want to cast at the database level, tells us the SQL query
Hi,
The site is maintained but not actively as I would like.
I've just added new example for the contact form.
http://www.web2pyref.com/example/contact-form-contact-form-with-recaptcha-and-gmail-smtp-service-app-1
My intention is to still continue adding new references and new examples
but
Thanks Anthony, great insight.
Most data is user-generated so the intent is to imply midnight at the
user's timezone, translate to UTC for storage, then apply the user's
timezone when displaying/editing. Can certainly switch to datetime field
and zero out the time.
Cheers,
Julian
On Sunday,
Somehow they got corrupted. To repair: 1) make sure the define_table
structure matches the tables as defined in the the database; 2) set
fake_migrate=True. Once it works remove fake_migrate=True and add
enable_migrate=False (do not touch them any more).
On Thursday, 22 October 2015 11:44:50
Docs say: This is a server for SMTP and related protocols, similar in
utility to the standard library’s smtpd.py module, but rewritten to be
based on asyncio for Python 3.
On Thursday, 22 October 2015 07:36:46 UTC-5, mcm wrote:
>
> Works on python2.7? or only 3.5?
>
> 2015-10-20 16:06 GMT+02:00
17 matches
Mail list logo