Re: [web2py] Re: request.requires_https() Python 3 bug

2019-03-15 Thread Lovedie JC
You could backup the web2py folder, the try the new web2py 2.18.4 then revert in case it doesn't work. Life is about taking risks. Regards On Sat, 16 Mar 2019, 01:08 Yi Liu wrote: > Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my > server. I experience a major bug on my loca

[web2py] Re: Web2py install script python 3/Apache/Ubuntu

2019-03-15 Thread 黄祥
might we know which script that you used ? check script is with python2 https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh check script is with python3 https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-ubuntu.sh best regards, stifan -- Resou

[web2py] Web2py install script python 3/Apache/Ubuntu

2019-03-15 Thread Mamisoa Andriantafika
Hi, I can't seem to find how to modify the one-step installation script so that web2py uses python 3. I tried pip3 venv on wen2py directory without success. It still shows (Running on Apache/2.4.29 (Ubuntu), Python 2.7.15rc1. Server is a fresh ubuntu server 18.04. any ideas? -- Resources:

[web2py] Re: request.requires_https() Python 3 bug

2019-03-15 Thread Yi Liu
Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my server. I experience a major bug on my local web2py with 2.18 series, re: Logger message error. I have decided to stay with 2.17.2 for now, on both local and server.

[web2py] Using lambda in Field constructor for default

2019-03-15 Thread Vlad
I am missing something very simple here, but can't unstuck myself: This is what I want to have in the Field constructor (though it's obviously incorrect): Field('link', default=lambda link, row: URL('podcast', 'episode/' + row.id, scheme=True, host=True)) I simply want one field to be determi

Re: [web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Stephan
I can't access appadmin under python 3: 'ascii' codec can't decode byte 0xea in position 1: ordinal not in range(128) web2py™ Version 2.18.4-stable+timestamp.2019.03.13.05.27.54 Python Python 3.5.2: /usr/local/bin/uwsgi (prefix: /usr)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most rece

Re: [web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Kevin Keller
Can you also test it with python3 please? On Fri, Mar 15, 2019 at 5:11 PM Stephan wrote: > Hello there, > > > when trying to add a user in the empty user table via appadmin, I get this > error: *'module' object has no attribute 'pbkdf2_hmac'* > Seems to be related to password encryption? > > > F

[web2py] error 'module' object has no attribute 'pbkdf2_hmac' when trying to add user (Ver 2.18.4)

2019-03-15 Thread Stephan
Hello there, when trying to add a user in the empty user table via appadmin, I get this error: *'module' object has no attribute 'pbkdf2_hmac'* Seems to be related to password encryption? Function argument list (data='!xb2qwtze', salt='b2dfc4f426ee1bbd', iterations=1000, keylen=20, hashfunc=

Re: [web2py] Re: Web2py binaries

2019-03-15 Thread Nico Zanferrari
Hi all, I've was successful in making the experimental Mac app, too, with python3. Grab it from https://github.com/nicozanf/web2py-pyinstaller , where there are also all the instructions in order to build it by yourself ;-) A private feedback is appreciated. Nico Il giorno ven 15 mar 2019 alle

[web2py] Re: Geometry fields and validators

2019-03-15 Thread Leonel Câmara
I think that's perfectly fine, I would just make a validator to wrap it so you can use it more easily. -- 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) --- Yo

[web2py] Re: Geometry fields and validators

2019-03-15 Thread David Orme
Thanks Leonel, I'd actually seen that solution, but that is specifically validating that the coordinates of a Point(X Y) WKT string are in the domain of a geographic coordinate system. I'm interested in the more general assessment of whether an alleged WKT string is well formatted - could be an

[web2py] Re: Geometry fields and validators

2019-03-15 Thread Leonel Câmara
This is the validator I use for my geometry fields import re from pydal.validators import Validator, ValidationError class IS_GEOLOCATION(Validator): """ Validate that the input is a location within latitude and longitude constraints. """ regex_geopoint = re.compile(r"""POINT

[web2py] Re: Mysql-Web2py connection failure

2019-03-15 Thread learthurjoly
Hi ! Thank you very much for taking time to answer me ! I have deployed my debian with web2py again and install MariaDB. It works I have no connection problem anymore ! Thanks a lot for your help. Le mercredi 13 mars 2019 11:28:00 UTC+1, Leonel Câmara a écrit : > > That's a pymysql problem

[web2py] Geometry fields and validators

2019-03-15 Thread David Orme
Hi, I'm looking for an approach to validate a user provided WKT geometry. The obvious answer is to let the spatial backend do the validation, so this works: if geometry is not None: geometry = db.executesql("select st_geomfromtext('{}');".format(geometry)) except ProgrammingError: rai

[web2py] Re: I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread João Matos
It worked, thanks. sexta-feira, 15 de Março de 2019 às 12:02:38 UTC, Leonel Câmara escreveu: > > This is how I do it in one of my websites > > in model: > > SUPPORTED_LANGUAGES = ('en', 'pt') # or just load this from config > > def pick_lang(): > twoletter = session.lang or T.accepted_language

[web2py] Re: I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread Leonel Câmara
This is how I do it in one of my websites in model: SUPPORTED_LANGUAGES = ('en', 'pt') # or just load this from config def pick_lang(): twoletter = session.lang or T.accepted_language[:2] if twoletter in SUPPORTED_LANGUAGES: T.force(twoletter) return twoletter else:

[web2py] I would like to allow the user to change the language, but I can't find why it isn't complying

2019-03-15 Thread João Matos
Hello, I copied the code from admin\views\layout.html to myapp\views\default\user.html and made 2 small changes to only allow 'en' and 'pt' and to the path. {{if hasattr(T,'get_possible_languages_info'):}} {{for langinfo in sorted([(code,info[1]) for code, info in iteritems(T

[web2py] Re: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
Here's an example I made long ago, I would do things differently nowadays but it shows how it can be done. https://groups.google.com/forum/#!topic/web2py/z_lGYsO6LKE -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - htt

[web2py] Re: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
It's possible but you need to use ajax to change the options in the invoices field. Basically you need to listen for change in client_id and when that happens you fire an ajax call and ask web2py for the new options and put them in the invoices field. -- Resources: - http://web2py.com - http:/

[web2py] Re: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread João Matos
I want the values shown in field form.invoices to be loaded from a db query (that uses the value of form.client_id) but only after the user selects the form.client_id and before the form is submited. Is this possible? sexta-feira, 15 de Março de 2019 às 10:44:53 UTC, Leonel Câmara escreveu: > >

[web2py] Re: "NameError: name 'pydal' is not defined" when function has typing type in def

2019-03-15 Thread João Matos
Apparently when importing the module, pydal is not loaded, but when running the function it is. Is this the correct behavior of web2py? sexta-feira, 8 de Março de 2019 às 18:39:36 UTC, João Matos escreveu: > > I'm using Python 3.7.1. Can that explain this strange situation? > I'm calling web2py w

[web2py] Re: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread Leonel Câmara
Like a computed value? I don't think I'm understanding. What exactly are you trying to do? -- 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 t

Re: [web2py] Re: Web2py online book page is returning an error

2019-03-15 Thread João Matos
Yes, now it's working. sexta-feira, 15 de Março de 2019 às 10:24:33 UTC, Nico Zanferrari escreveu: > > I had the ticket even on the main page, but it worked fine some hours > later. Now I cannot see any problem at all. > > Nico > > > > Il giorno ven 15 mar 2019 alle ore 09:46 João Matos > ha sc

Re: [web2py] Re: Web2py online book page is returning an error

2019-03-15 Thread Nico Zanferrari
I had the ticket even on the main page, but it worked fine some hours later. Now I cannot see any problem at all. Nico Il giorno ven 15 mar 2019 alle ore 09:46 João Matos ha scritto: > http://web2py.com/books/default/search/29?search=signature > > sexta-feira, 15 de Março de 2019 às 03:54:07

[web2py] Re: Is it possible to make a form field depend on another form field without submiting the form?

2019-03-15 Thread João Matos
Sorry. I didn't explain myself correctly. What I meant was depend one field values (db search) depend on another field value. Something like this pseudo code: if form client_id: form.invoices = db(db.invoice(client_id == form.client_id)).select() Is this possible without submitting the form?

[web2py] Re: Web2py online book page is returning an error

2019-03-15 Thread João Matos
http://web2py.com/books/default/search/29?search=signature sexta-feira, 15 de Março de 2019 às 03:54:07 UTC, Massimo Di Pierro escreveu: > > which page? > > On Wednesday, 13 March 2019 02:12:32 UTC-7, João Matos wrote: >> >> Web2py online book page is returning an error >> >> Internal errorTicket