Re: [web2py] is_active column in auth_user - a question

2014-03-16 Thread Kiran Subbaraman
Vinicius, Thanks for the details. Will take a look at the code, and also create a pull-request for the documentation - if I have some details to add. Thanks -Kiran On Wednesday, March 12, 2014 7:27:16 PM UTC+5:30, viniciusban wrote: On Wed, Mar 12, 2014 at 8:42 AM, Kiran Subbaraman

[web2py] Re: web2py_htmltable styling - source code to be corrected?

2014-03-16 Thread Kiran Subbaraman
Am unable to reply to the discussion of this topic on web2py-developers: https://groups.google.com/forum/#!topic/web2py-developers/6KkkGeQSEUg Last 3 replies have been marked as deleted. Not sure what is going on there. -Kiran On Thursday, March 6, 2014 7:26:57 PM UTC+5:30, Massimo Di Pierro

[web2py] Re: Verbatim Tag

2014-03-16 Thread David Simmons
Hi Massimo I've spent some time thinking about my own suggestion and I now believe that changing the delimiter in either Web2py or Angular is actually a better idea than mine. I'm happy to either withdraw my proposal or submit if you think it should be discussed further. cheers Dave --

[web2py] URL with all current args and vars

2014-03-16 Thread Gael Princivalle
Hello all. How can I add to my URL helper all current args and vars ? I would like to do something like that for language switching : My current URL is: mydomain.com/en/concert?id=2 With that: URL('it', f=request.function, args=request.args, vars=request.vars) I would like to go to:

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Tim Richardson
Apache on linux can run WSGI in multi process mode as well as multithreaded mode according to the docs. This would eliminate the GIL as a factor. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Date format

2014-03-16 Thread Gael Princivalle
Hi all. So, I save my date like that in my table: db.define_table('concerts', Field('concert_date', type='date', requires = IS_DATE(format ='%Y-%m-%d'))... My controller for displaying one record: def concert(): id_concert = request.vars['id'] concert =

[web2py] Re: Date format

2014-03-16 Thread Gael Princivalle
Of course like that it works fine: {{=(concert.concert_date.strftime(%d/%m/%Y))}} But I was thinking there was a way to do that with T(). Il giorno domenica 16 marzo 2014 10:09:20 UTC+1, Gael Princivalle ha scritto: Hi all. So, I save my date like that in my table:

[web2py] Changes in db.py don't have any effect

2014-03-16 Thread Gael Princivalle
Well a bad journey. When I do changes in my db.py like adding fields, changes don't apply. All applications changes (views/controllers...) works but not in db.py. In the db administrative interface new fields are not displayed. I've reset Apache, clear the cache, and I'm in anonymous mode with

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread 黄祥
it's hard to found the root cause, because you don't show any code of your db.py i guess it related with the migrate settings. e.g. migrate = True, fake_migrate_all = False best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread Gael Princivalle
Yes Stifan, with migrate = True, fake_migrate_all = False changes have effect. Thanks a lot. Can you explain me why ? Regards. Il giorno domenica 16 marzo 2014 11:47:02 UTC+1, 黄祥 ha scritto: it's hard to found the root cause, because you don't show any code of your db.py i guess it

[web2py] Re: Bootstrap3 package - help to test

2014-03-16 Thread Paolo Caruccio
Hi Dmitry, reCaptcha was not included in the package. I will use your code in the next version of the package. Thank you. Il giorno domenica 16 marzo 2014 03:12:43 UTC+1, Dmitry Rodetsky ha scritto: Ok it seems I got this thing fixed up. The problem was in the bootstrap3.py module. I am

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread 黄祥
please take a look at this discussion : https://groups.google.com/forum/#!topic/web2py/9nI1I58f6ag niphlod explain detail about migrate. it seems there is in another discussion with example, but sorry, i can't found it. best regards, stifan -- Resources: - http://web2py.com -

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread horridohobbyist
I've conducted a test with Flask. fred.py is the command line program. hello.py is the Flask program. default.py is the Welcome controller. testdata.txt is the test data. shippackage.py is a required module. fred.py: 0.024 second 0.067 second hello.py: 0.029 second 0.073 second default.py:

[web2py] Re: URL with all current args and vars

2014-03-16 Thread Anthony
URL(..., args=request.args, vars=request.get_vars) is the right way to construct a URL that includes the args and query string variables from the current request. However, I assume you don't actually have controllers named en.py and it.py, so you shouldn't be passing the language codes as the

[web2py] Re: URL with all current args and vars

2014-03-16 Thread Gael Princivalle
Yes you're right, I don't have any controller en.py or it.py. It was a way to change the uri_language. If I take off 'it' form the URL helper how can i force the language ? I've read somewhere that it's possible to do it within the URL helper but I don't know how. Now I have:

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread Gael Princivalle
I've take a look thanks. First I've said you that the problem was resolved but it's not, I've tried the wrong db. With that: db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all'],migrate = True, fake_migrate_all = False) Situation is the same, all changes in db.py don't have

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread 黄祥
had you already try migrate = True and fake_migrate_all = True ? best regards, stifan -- 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

[web2py] Re: Changes in db.py don't have any effect

2014-03-16 Thread Gael Princivalle
Yes, both with True. Anyway I've rebuild my app why an old version, thanks ! Il giorno domenica 16 marzo 2014 20:38:18 UTC+1, 黄祥 ha scritto: had you already try migrate = True and fake_migrate_all = True ? best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Re: How to use AJAX within a SQLFORM.grid 'add' form

2014-03-16 Thread backseat
Is it expected that AJAX can be used within the Add form of a SQLFORM.grid? If so, what am I doing wrong (or is it a bug)? Thanks, Keith -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Multiple args to requires

2014-03-16 Thread Gael Princivalle
Hello all. Is it possible to have multiple args to requires ? I want to have a field with a dropdown menu with rows from another table, and this field cannot be empty. db.define_table('countries', Field('name', type='string')) db.define_table('concerts',

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Michele Comitini
gunicorn instructions: $ pip install gunicorn $ cd root dir of web2py $ gunicorn -w 4 gluon.main:wsgibase 2014-03-16 14:47 GMT+01:00 horridohobbyist horrido.hobb...@gmail.com: I've conducted a test with Flask. fred.py is the command line program. hello.py is the Flask program. default.py

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread horridohobbyist
Well, I managed to get *gunicorn* working in a roundabout way. Here are my findings for the fred.py/hello.py test: Elapsed time: 0.028 Elapsed time: 0.068 Basically, it's as fast as the command line test! I'm not sure this tells us much. Is it Apache's fault? Is it web2py's fault? The test is

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Michele Comitini
You basically need to cd into the directory where you have unzipped web2py. Then run gunicorn like the following: gunicorn -w 4 gluon.main:wsgibase There you have web2py reachable on http://localhost:8000 Which part does not work for you? 2014-03-16 21:31 GMT+01:00 horridohobbyist

[web2py] Re: Multiple args to requires

2014-03-16 Thread 黄祥
Field('country', type='string', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, ' countries.id', '%(name)s')])) should be: Field('country', type='string', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db. countries.id, '%(name)s')])) another way around : Field('country', type='string', requires=IS_IN_DB(db,

[web2py] Re: Multiple args to requires

2014-03-16 Thread Gael Princivalle
Thanks a lot ! Il giorno domenica 16 marzo 2014 21:51:06 UTC+1, 黄祥 ha scritto: Field('country', type='string', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, ' countries.id', '%(name)s')])) should be: Field('country', type='string', requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db. countries.id,

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Jonathan Lundell
On 16 Mar 2014, at 1:31 PM, horridohobbyist horrido.hobb...@gmail.com wrote: Well, I managed to get gunicorn working in a roundabout way. Here are my findings for the fred.py/hello.py test: Elapsed time: 0.028 Elapsed time: 0.068 Basically, it's as fast as the command line test! I'm

[web2py] Re: web2py_htmltable styling - source code to be corrected?

2014-03-16 Thread Massimo Di Pierro
I have seen a number of replies been marked as deleted recently. All I can say is that we never delete replies. It must be a google bug. On Sunday, 16 March 2014 01:11:55 UTC-5, Kiran Subbaraman wrote: Am unable to reply to the discussion of this topic on web2py-developers:

[web2py] Re: Verbatim Tag

2014-03-16 Thread Massimo Di Pierro
I am glad you agree but if there is consensus in implementing your original request, I do not have a problem with it. On Sunday, 16 March 2014 03:17:22 UTC-5, David Simmons wrote: Hi Massimo I've spent some time thinking about my own suggestion and I now believe that changing the delimiter

[web2py] Re: Date format

2014-03-16 Thread Massimo Di Pierro
There is {{=(concert.concert_date.strftime(str(T(%Y-%m-%d}} On Sunday, 16 March 2014 04:50:42 UTC-5, Gael Princivalle wrote: Of course like that it works fine: {{=(concert.concert_date.strftime(%d/%m/%Y))}} But I was thinking there was a way to do that with T(). Il giorno domenica 16

[web2py] Pulling data every 30s for a ticker with web2py

2014-03-16 Thread Martin
Hi all, Please could anyone help me out, I need to pull some data from some API (ex: https//xxx/aaa/ etc.) every 30s and then display the result in a ticker How do I do this with Web2py + JavaScript ? I am new to web2py. Thank you. -- Resources: - http://web2py.com - http://web2py.com/book

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Massimo Di Pierro
In order to isolate the problem one must take it in steps. This is a good test but you must first perform this test with the code you proposed before: def test(): t = time.time start = t() x = 0.0 for i in range(1,5000): x += (float(i+10)*(i+25)+175.0)/3.14

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread horridohobbyist
Failed to find application: 'gluon.main' 2014-03-15 02:23:51 [22339] [INFO] Worker exiting (pid: 22339) ... Traceback (most recent call last): File /usr/local/bin/gunicorn, line 9, in module load_entry_point('gunicorn==18.0', 'console_scripts', 'gunicorn')() ... gunicorn.errors.HaltServer:

[web2py] ExportClasses on grid

2014-03-16 Thread Leonardo Pires Felix
Hi, There is how change the default exportclasses on web2py without modify in the code of web2py, and without expliciting it in all my grids? I didn't found anything. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: request.user_agent().is_mobile

2014-03-16 Thread vince
clean doesn't work for me too on 2.9.5, only request.user_agent()['is_mobile'] works. On Friday, November 29, 2013 11:46:56 AM UTC+8, Tim Richardson wrote: To fix this, you need to clear sessions. The easiest way to do this is via the admin app. Find the application causing problems, and

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Massimo Di Pierro
web2py comes with anyserver.py you just do: python anyserver.py -H for help. One of the command line options is to run with gunicorn. You can try tornado, and any other server out there. On Sunday, 16 March 2014 17:09:40 UTC-5, horridohobbyist wrote: Failed to find application: 'gluon.main'

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Massimo Di Pierro
easy_install gunicorn cd web2py python anyserver.py -s gunicorn -i 127.0.0.1 -p 8000 Anyway, you need to run a test that does not include import Package first Because definitively treats imports differently. That must be tested separately. Massimo On Sunday, 16 March 2014 15:31:17 UTC-5,

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread horridohobbyist
Okay, I did the calculations test in my Linux VM using command line (fred0), Flask (hello0), and web2py (Welcome). fred0: elapsed time: 0.00159001350403 fred0: elapsed time: 0.0015709400177 fred0: elapsed time: 0.00156021118164 fred0: elapsed time: 0.0015971660614 fred0: elapsed time:

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread horridohobbyist
Using gunicorn (Thanks, Massimo), I ran the full web2py Welcome code: Welcome: elapsed time: 0.0511929988861 Welcome: elapsed time: 0.0024790763855 Welcome: elapsed time: 0.00262713432312 Welcome: elapsed time: 0.00224614143372 Welcome: elapsed time: 0.00218415260315 Welcome: elapsed time:

[web2py] Re: Understanding translation and accept-language header?

2014-03-16 Thread User
Thank you this is what was missing from my understanding, changing langcode to en-gb, caused en-us.py translation to be picked up and en-gb.py to not be. On Friday, March 14, 2014 8:49:17 PM UTC-4, LightDot wrote: I'm less familiar with the translation parts of web2py that I'd like to be,

[web2py] Re: Understanding translation and accept-language header?

2014-03-16 Thread User
I was manually setting T.current_languages = ['en'] in db.py but am I correct that this statement has no impact then? It doesn't seem to do anything. Even setting to T.current_languages = ['es'] has no impact. On Saturday, March 15, 2014 8:38:58 PM UTC-4, Massimo Di Pierro wrote: Yes. This

Re: [web2py] Re: Python Performance Issue

2014-03-16 Thread Massimo Di Pierro
What kind of VM is this? What is the host platform? How many CPU cores? Is VM using all the cores? The only thing I can think of is the GIL and the fact that multithreaded code in python gets slower and slower the more cores I have. On my laptop, with two cores, I do not see any slow down.

[web2py] Re: URL with all current args and vars

2014-03-16 Thread Anthony
URL(f=request.function, args= request.args, vars=request.vars, language= 'it') URL does now take a language argument (in the current version of web2py). You can also try: request.uri_language = 'it' to force a different language to be included in the URL. Anthony -- Resources: -

Re: [web2py] Re: URL with all current args and vars

2014-03-16 Thread Jonathan Lundell
On 16 Mar 2014, at 9:49 PM, Anthony abasta...@gmail.com wrote: URL(f=request.function, args= request.args, vars=request.vars, language='it') URL does now take a language argument (in the current version of web2py). You can also try: request.uri_language = 'it' to force a different