[web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-18 Thread Sneka R
Actually I added the following line on top of the custom_exporter.py file import cStringIO On Friday, July 15, 2016 at 10:45:01 PM UTC-5, Jordan Myers wrote: > > Hey everyone, > > so the default csv exporters for sqlform.grid will use the headers as the > 'database' names, but I would rather it

Re: [web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-18 Thread Jordan Myers
Oh yeah, changes to modules are not updated by default. Add this line to your models/db.py file: from gluon.custom_import import track_changes; track_changes(True) For more information on using modules with web2py, check out:

[web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-18 Thread Sneka R
Followed your instructions, but I am getting this Traceback Traceback 1. 2. 3. 4. 5. 6. 7. Traceback (most recent call last): File "/Users/sraveend/Documents/web2py/gluon/restricted.py", line 227, in restricted exec ccode in environment File

[web2py] UWSGI root vs limited user.

2016-07-18 Thread Michael Messmer
Environment nginx & uwsgi Rhel7 web2py: Version 2.14.6-stable+timestamp.2016.05.09.19.18.48 (Running on Unknown, Python 2.7.5) --- uwsgi.ini file --- [uwsgi] master = true processes = 4 max-requests = 50 enable-threads = true chdir = /opt/www-data/web2py module = wsgihandler:application

Re: [web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-18 Thread Jordan Myers
I just put it in it's own file in the modules directory and called it "custom_exporter.py" You will need to put this at the top of the file: from gluon.sqlhtml import ExportClass When I want to use it in a controller with SQLFORM.grid, I must first import it at the top of the controller file:

[web2py] Re: Two Step Verification - OTP

2016-07-18 Thread 黄祥
my bad it's all about verification result, the code works well now : models/db.py *pyotp verify* auth.settings.auth_two_factor_enabled = True def _set_two_factor(user, auth_two_factor): return None def verify_otp(user, otp): import pyotp #pyotp.random_base32() # generate random

[web2py] Re: Can't get a working web2py that will support many of the example apps. Most seem to be broken!

2016-07-18 Thread Anthony
On Monday, July 18, 2016 at 10:08:02 AM UTC-4, Jim Spoerl wrote: > > Well, I have made some progress with the help provided here. Thanks so > much for that. > > Now I seem to be facing another issue that I do not understand. If using > the MARKMIN access @#/name.type for referencing

[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-18 Thread Anthony
You cannot pass a URL to the open() function -- you must use something like urllib2 or the requests library to retrieve data from a URL. Anthony On Monday, July 18, 2016 at 10:43:54 AM UTC-4, Daniel wrote: > > Hi guys thanks again for your help. So I am using a stream object as > outlined in

[web2py] Re: How to export sqlform.grid with the labeled column names

2016-07-18 Thread Sneka R
I am new to web2py. Which file should I make these changes? Thanks. On Friday, July 15, 2016 at 10:45:01 PM UTC-5, Jordan Myers wrote: > > Hey everyone, > > so the default csv exporters for sqlform.grid will use the headers as the > 'database' names, but I would rather it use the field.label

[web2py] Re: session error

2016-07-18 Thread Dave S
On Saturday, July 16, 2016 at 11:54:18 AM UTC-7, Dmitri Ermolaev wrote: > > I use > > if not request.env.web2py_runtime_gae: > migrate = 0 > fake_migrate = myconf.take('db.fake_migrate') and True or False > migrate = (myconf.take('db.migrate') or migrate) and True or False > ##

[web2py] Re: Web2py scheduler linked postgres processes consuming too much memory

2016-07-18 Thread Niphlod
you're seeing a totally normal thing: postgresql spawns a different process for each connection. Those processes in linux are fork()s, so even if you SEEM to notice a skyrocket in memory utilization summing all different processes (e.g. in "top"), in reality it's not sucking up every bit of

[web2py] Re: user name case sensitivity

2016-07-18 Thread Antonio Salazar
In db.py, after declaring auth, use this to save all usernames and emails as lowercase. auth.settings.username_case_sensitive = False auth.settings.email_case_sensitive = False On Friday, July 15, 2016 at 11:37:41 AM UTC-5, kstesr...@gmail.com wrote: > > > Team, > > I see the login user is

[web2py] Re: auth.settings.auth_two_factor_enabled = True gives me setting key 'auth_two_factor_enabled' does not

2016-07-18 Thread Bernardo Leon
Thanks for your reply, I was making a mistake. I have been calling auth.define_tables(...) before auth.settings.extra_fields['auth_user'] = [Field()] I have switched between them and now I have my field in the database so thank you :) Now I have Google authentication working, thank you

[web2py] Re: Get image from url and save in uploads folder - AttributeError

2016-07-18 Thread Daniel
Hi guys thanks again for your help. So I am using a stream object as outlined in the book, however its throwing 'no such file or directory'. But when I go to the url there is a jpg file attached. I thought it could be because the url does not end with the file extension, however I tried a

[web2py] Re: Can't get a working web2py that will support many of the example apps. Most seem to be broken!

2016-07-18 Thread Jim Spoerl
On Thursday, July 7, 2016 at 7:35:08 AM UTC-4, Jim Spoerl wrote: > > Hi all. > > I am very frustrated, I must say. After several weeks of work (and > reading and re-reading all that I have found online), I simply cannot get > installed a working environment. I do now have the latest stable

[web2py] Re: Can't get a working web2py that will support many of the example apps. Most seem to be broken!

2016-07-18 Thread Jim Spoerl
Well, I have made some progress with the help provided here. Thanks so much for that. Now I seem to be facing another issue that I do not understand. If using the MARKMIN access @#/name.type for referencing attached media files to a page in the builtin wiki, I end up with the problem

[web2py] Re: how to know which users are currently logged in?

2016-07-18 Thread Anthony
Keep in mind that by default, the login remains active for an hour after the last request, so someone who is actively using the site for over 30 minutes won't be included in that query. Of course, you could extend the window, but then you will end up including more and more inactive users.

[web2py] switch between standard and testing database?

2016-07-18 Thread Mirek Zvolský
I use postgres database dbapp I am trying to make splinter tests and want to run them over the 2nd database dbapp_tests. First attempt I made with starting Web2py on different port, :8001, then I detect the port from request object and I create db= choosing from 2 different appconfig.ini

[web2py] Re: env vars in appconfig.ini

2016-07-18 Thread LMK
Thanks. I will open an issue on GitHub. -- 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 subscribed to the