[web2py] Re: How to customize "Invalid function/someview" ?

2020-04-30 Thread 'Annet' via web2py-users
I think routes_onerror = [] in routes.py is whar you're looking for: routes_onerror = [ ,(r'*/404', r'/handler/default/on_404_error') ,(r'*/*', r'/handler/default/onerror') ] Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.co

[web2py] Re: Server error when accessing admin

2020-04-30 Thread 'Annet' via web2py-users
Why didn't you use the web2py install/unstall script that webfaction provides? It installs web2py served via nginx and uWSGI. The script mentions 2 caveats: Web2py won't work properly if it is mounted to a sub-URL like http://domain.com/web2py/. Instead, it must be mounted to the website root, e

[web2py] Re: Server error when accessing admin

2020-04-30 Thread Ian W. Scott
Thanks Annet for your help. Webfaction doesn't seem currently to make that install script available when you're creating a new application in a server. Web2py doesn't appear anywhere on the list of available application types. Do you know if it's available somewhere else on their service? Thank

[web2py] Re: Server error when accessing admin

2020-04-30 Thread 'Annet' via web2py-users
Hi Ian, I do have a copy of the script, it's a bit old, but I'll attach it anyway, maybe it's of help. Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

Re: [web2py] Re: Server error when accessing admin

2020-04-30 Thread Ian W. Scott
Thanks very much Ian W. Scott, PhD Associate Professor of New Testament Tyndale Seminary, Toronto, Canada www.ianwscott.com (http://www.ianwscott.com) Paul's Way of Knowing: Story Experience and the Spirit (Baker Academic [Mohr Siebeck], 2006) The Online Critical Pseudepigrapha (SBL, 2006-; pseu

[web2py] Menu no longer renders {{=MENU(response.menu)}}

2020-04-30 Thread 'Annet' via web2py-users
In web2py 2.14 I had the following code in menu.py response.menu = [ (CAT(SPAN('Log in', _class="btn btn-primary")), False, URL('controlpanel', 'default', 'user', args='login', scheme=SECURESCHEME, host=CONTROLPANELDOMAIN)), (CAT(SPAN('Open account', _class="btn btn-success")), False, U

[web2py] Ansible playbook to install web2py on Ubuntu 20.04

2020-04-30 Thread Jim S
I've created an Ansible playbook for installing web2py on Ubuntu 20.04. It can be found at https://github.com/jpsteil/web2py_ansible_playbook I created it based on the setup-web2py-nginx-uwsgi-ubuntu.sh script in the web2py scripts directory and on the document that Clemens shared in this threa

[web2py] SQLFORM keepvalues - only 1 field

2020-04-30 Thread Jim S
Does anyone know how I can have a form 'keepvalues' but only keep one specific field value? I don't want it to keep the values for all the fields, just for the one specific field. Anyone tried this before? -Jim -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http

[web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Scott Hunter
I recall doing this by "pre-populating" the field you want to keep with the old value. - Scott On Thursday, April 30, 2020 at 11:10:42 AM UTC-4, Jim S wrote: > > Does anyone know how I can have a form 'keepvalues' but only keep one > specific field value? I don't want it to keep the values for

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Jim Steil
I was hoping to avoid those tricks. I too have done this by storing values in the session to be redisplayed. I was hoping that the keepopts argument to SQLFORM would allow you to specify which fields to keep, but it seems that is used for something else. On Thu, Apr 30, 2020 at 11:48 AM Scott Hu

Re: [web2py] Re: How to customize "Invalid function/someview" ?

2020-04-30 Thread Christian Varas
Thanks for the help! Now I have a custom 40x error pages :) Cheers. Chris. El jue., 30 abr. 2020 a las 5:13, 'Annet' via web2py-users (< web2py@googlegroups.com>) escribió: > I think routes_onerror = [] in routes.py is whar you're > looking for: > > routes_onerror = [ >,(r'*/404', r'/handl

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Scott Hunter
Since the value in question is part of the current submission, isn't the value available in form.vars? - Scott On Thursday, April 30, 2020 at 12:54:02 PM UTC-4, Jim S wrote: > > I was hoping to avoid those tricks. I too have done this by storing > values in the session to be redisplayed. I wa

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Jim Steil
Yes, but I need that value on the next time through the method. Therefore I have to save it to my session and grab it the next time in. Am I missing something? On Thu, Apr 30, 2020 at 12:19 PM Scott Hunter wrote: > Since the value in question is part of the current submission, isn't the > valu

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Scott Hunter
Isn't "the next time through the method" when there is a new submission, which would have the saved value in it (unless the user changed it)? Maybe a sample of your code would make things clearer. On Thursday, April 30, 2020 at 1:21:53 PM UTC-4, Jim S wrote: > > Yes, but I need that value on th

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Jim S
Here is what I'm talking about: def update_something(): fields = [Field('name'), Field('address', 'text'), Field('city'), Field('state'), Field('zip_code')] form = SQLFORM.factory(*fields) if form.process().accepted: #

Re: [web2py] Re: Server error when accessing admin

2020-04-30 Thread Ian W. Scott
Unfortunately I don't know anything about nginx. I've always worked with apache2. Can anyone suggest how to debug this? I'm really at the end of my rope here. On Thursday, April 30, 2020 at 10:37:58 AM UTC-4, Ian W. Scott wrote: > > Thanks very much > > Ian W. Scott, PhD > Associate Professor of

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Scott Hunter
Would this do the job? form = SQLFORM.factory(*fields) if form.process().accepted: # update the database here form2 = SQLFORM.factory(*fields) form2.vars['state'] = form.vars.state form2.process() else: form2 = form return dict(form

Re: [web2py] Re: SQLFORM keepvalues - only 1 field

2020-04-30 Thread Jim S
Wow, that is clever! And, works just how I want it to. Thanks so much for the pointer. -Jim On Thursday, April 30, 2020 at 2:14:48 PM UTC-5, Scott Hunter wrote: > > Would this do the job? > > form = SQLFORM.factory(*fields) > if form.process().accepted: > # update the database

[web2py] web2py and ubuntu 20lts

2020-04-30 Thread Maurice Waka
I recently moved to ubuntu 20LTS and on login to web2py I get this error: Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. Traceback (most recent call last): File "/home/maurice/web2py/gluon/main.py", line 440, in wsgibase serve_controller(request, response, session) File "/home/m

[web2py] How to debug appadmin CSV uploading

2020-04-30 Thread Jon Subscripted
Hi everyone, I'm trying to upload a CSV file to my MySQL database using appadmin. I do get a "data uploaded" flash message as if I succeeded, but data is not there. Could anyone suggest me how to debug this operation? Thanks, Jon.