[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-26 Thread Niphlod
+1 for switching to nginx. actually, what I meant to write is request.env.get('QUERY_STRING') On Friday, February 27, 2015 at 5:53:57 AM UTC+1, Mike wrote: On Wednesday, February 25, 2015 at 12:18:29 PM UTC-8, Niphlod wrote: reaally strange, although I don't use lighttpd since nginx came

Re: [web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Right. The purpose of using the console was to simulate what actually happens in production. On Thu, Feb 26, 2015 at 11:39 PM, Niphlod niph...@gmail.com wrote: you know that on console, after queue_task() you need to commit(), right ? If you leave the transaction hanging, no wonder that you're

[web2py] Sorting contains results based on number of matches

2015-02-26 Thread James Burke
Is there a way to sort the query below by the number of search items found in each result? def GET(*args,**vars): search = [x for x in request.vars['search'].split(' ') if len(x) 3] result = [] if search: query = db.question.heading.contains(search,

[web2py] Re: DAL for Insert Into with Select

2015-02-26 Thread Niphlod
why don't you just use db.table.insert()? anyway, db.executesql() has a placeholders parameter that can pass quoted variables just fine! On Friday, February 27, 2015 at 12:39:50 AM UTC+1, Mat Miles wrote: Is it possible to use the DAL to run an INSERT INTO with a select list? I haven't

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
you know that on console, after queue_task() you need to commit(), right ? If you leave the transaction hanging, no wonder that you're observing deadlocks! On Friday, February 27, 2015 at 3:38:19 AM UTC+1, Osman Masood wrote: I was actually able to easily reproduce this. Just open up 2 web2py

[web2py] Re: When not HTTPS i receive TypeError: 'NoneType' object is not callable

2015-02-26 Thread Leonel Câmara
I think this is probably a webserver (probably apache) configuration issue. Have you made any changes to the configuration recently? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] change edit button link in SQLFORM?

2015-02-26 Thread LoveWeb2py
I think this should be pretty easy, but I couldn't find how to edit the SQLFORM buttons in the documentation: http://web2py.com/book/default/chapter/07#SQLFORM-grid-and-SQLFORM-smartgrid Essentially I have a function I want the edit button to use instead of editing the record called in the

[web2py] Re: not web2py question - test timezone detection

2015-02-26 Thread Niphlod
On Wednesday, February 25, 2015 at 10:25:26 PM UTC+1, Dave S wrote: On Wednesday, February 25, 2015 at 7:45:03 AM UTC-8, Niphlod wrote: if a module is required, it is imported. What names can be be imported? Must a 3rd-party module be renamed to fit the plug-in scheme? My

Re: [web2py] Is there a way to set breakpoints inside the gluon?

2015-02-26 Thread Richard Vézina
How do you import your file? You may try to import it with web2py shell by hand you may get more insight like that. Richard On Thu, Feb 26, 2015 at 9:41 AM, David Manns dgma...@gmail.com wrote: I'm trying to build a test database using csv_import_from_file to load an entire database (I

Re: [web2py] pycharm python console

2015-02-26 Thread Richard Vézina
I can't see passing web2py init from command line with pdb, I try python -m pdb web2py -a 'pwd' -i 127.0.0.1 -p 8001 -R AppName -M But I just can see the os import, then the rocket server get started. :( Richard On Thu, Feb 26, 2015 at 11:00 AM, Richard ml.richard.vez...@gmail.com wrote: We

Re: [web2py] pycharm python console

2015-02-26 Thread Richard Vézina
Though I don't think environnement is defined... On Thu, Feb 26, 2015 at 10:56 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: I would try to use run_models_in so far it seems that this is the function/method that will generate python import models in compiledapp.py On Thu, Feb 26,

Re: [web2py] web2py menu and CTRL+Click redirect both actual and new tab

2015-02-26 Thread Richard Vézina
On Wed, Feb 25, 2015 at 5:15 PM, Dave S snidely@gmail.com wrote: On Wednesday, February 25, 2015 at 11:25:06 AM UTC-8, Richard wrote: Hello, I am not sure where is it from, but I notice and change in the behavior of CTRL + Click over main web2py menu and submenu entry which in the

Re: [web2py] pycharm python console

2015-02-26 Thread Richard Vézina
Things are in gluon/shell.py... Richard On Thu, Feb 26, 2015 at 10:08 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Don't use it :D No, I am kidding... Here settings for python console : https://www.jetbrains.com/pycharm/help/console-python-console.html I don't how someone can

Re: [web2py] pycharm python console

2015-02-26 Thread Richard Vézina
I would try to use run_models_in so far it seems that this is the function/method that will generate python import models in compiledapp.py On Thu, Feb 26, 2015 at 10:50 AM, António Ramos ramstei...@gmail.com wrote: dont i have to force it to do python web2py.py - S myapp at startup ?

Re: [web2py] pycharm python console

2015-02-26 Thread Richard Vézina
Don't use it :D No, I am kidding... Here settings for python console : https://www.jetbrains.com/pycharm/help/console-python-console.html I don't how someone can lunch pycharm embed python console with command line web2py option... Another option could be to import web2py stuff once the

Re: [web2py] pycharm python console

2015-02-26 Thread António Ramos
it already does this at init import sys; print('Python %s on %s' % (sys.version, sys.platform)) sys.path.extend(['C:\\web2pyGit\\web2py2\\applications\\teste1', 'C:\\web2pyGit\\web2py2\\gluon']) 2015-02-26 15:08 GMT+00:00 Richard Vézina ml.richard.vez...@gmail.com: Don't use it :D No, I am

Re: [web2py] pycharm python console

2015-02-26 Thread António Ramos
dont i have to force it to do python web2py.py - S myapp at startup ? 2015-02-26 15:39 GMT+00:00 Richard Vézina ml.richard.vez...@gmail.com: Things are in gluon/shell.py... Richard On Thu, Feb 26, 2015 at 10:08 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Don't use it :D

[web2py] Could we start web2py form python shell

2015-02-26 Thread Richard
Hello, Is it possible to acheive the starting of web2py from python shell? It could be interresting to be able to start web2py env as command line do, but from python shell in order to lunch web2py environnement inside running python console like the one available in PyCharm... This thread

Re: [web2py] pycharm python console

2015-02-26 Thread Richard
We may have more input here too : https://groups.google.com/d/msg/web2py/69ji7YH6Ufw/xRaFTBO9W0IJ :) Richard Le jeudi 26 février 2015 10:57:49 UTC-5, Richard a écrit : Though I don't think environnement is defined... On Thu, Feb 26, 2015 at 10:56 AM, Richard Vézina

[web2py] Re: gluon.validators.IS_LENGTH object at 0x7ff634bd0

2015-02-26 Thread Leonel Câmara
I don't see how this is happening unless you're redefining the requires for that field somewhere to IS_LENGTH. Can you search your code for db.table.URL.requires (replacing table with the name). How do you know that's there for that field? Show us some code :) -- Resources: -

[web2py] Re: Function being called twice from one button click

2015-02-26 Thread Anthony
In any case, you should probably have some code that prevents double booking (i.e., the first time you receive a request with the confirmation, make some change in the session or db that prevents the same order from being confirmed/fulfilled twice). Anthony On Thursday, February 26, 2015 at

[web2py] pycharm python console

2015-02-26 Thread António Ramos
To the ones that use pycharm with web2py. How can i interact with my models from the python console ? it does not recognize my models. Regards António -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Function being called twice from one button click

2015-02-26 Thread Leonel Câmara
I don't see how it can happen. Your costumer probably has a virus or something. It may also be a buggy browser extension (tell him to try with the browser in private mode so the extensions are off). -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] Routes pattern and args / query strings

2015-02-26 Thread Anthony
On Thursday, February 26, 2015 at 3:35:50 AM UTC-5, Louis Amon wrote: That’s actually what I ended up doing, but it isn’t something you can rely on in a big project… Why not? Because you’d have to document very clearly the fact that some specific rules need to be organized in a precise

[web2py] Is there a way to set breakpoints inside the gluon?

2015-02-26 Thread David Manns
I'm trying to build a test database using csv_import_from_file to load an entire database (I successfully use csv_export_to_file to create a file from my application running in the GAE SDK; that database was copied from GAE production using bulk upload). However, the import process seems to

[web2py] Re: change edit button link in SQLFORM?

2015-02-26 Thread Niphlod
you have two methods: - set editable=False and use your own links= - check for 'edit' in request.args and override accordingly On Thursday, February 26, 2015 at 3:30:07 PM UTC+1, LoveWeb2py wrote: I think this should be pretty easy, but I couldn't find how to edit the SQLFORM buttons in the

[web2py] Re: Websocket doesn't work on stable version

2015-02-26 Thread Jose de Soto
Hi, It looks that in Tornado 4.X has been included: * check_origin*, here more info: http://tornado.readthedocs.org/en/latest/websocket.html#tornado.websocket.WebSocketHandler.check_origin In the DistributeHandler, you can insert the next code: *def check_origin(self, origin):* *

[web2py] Re: change edit button link in SQLFORM?

2015-02-26 Thread LoveWeb2py
Went with option #1, Niphlod. Thanks! On Thursday, February 26, 2015 at 12:02:05 PM UTC-5, Niphlod wrote: you have two methods: - set editable=False and use your own links= - check for 'edit' in request.args and override accordingly On Thursday, February 26, 2015 at 3:30:07 PM UTC+1,

[web2py] Re: Function being called twice from one button click

2015-02-26 Thread peter
Thanks for your replies. I guess you are right Anthony, one should handle unlikely events even if they are normally rare. The site did already does this for paying bookings, but I did not expect the duplicates on reservations. I have now prevented multiple reservations from a single confirm.

[web2py] Re: Function being called twice from one button click

2015-02-26 Thread Dave S
On Thursday, February 26, 2015 at 9:50:26 AM UTC-8, peter wrote: Thanks for your replies. I guess you are right Anthony, one should handle unlikely events even if they are normally rare. The site did already does this for paying bookings, but I did not expect the duplicates on

Re: [web2py] Routes pattern and args / query strings

2015-02-26 Thread Louis Amon
That’s actually what I ended up doing, but it isn’t something you can rely on in a big project… Why not? Because you’d have to document very clearly the fact that some specific rules need to be organized in a precise order among the list. If you have hundreds of URLs managed in your

[web2py] Using CAS for non web2py apps

2015-02-26 Thread Kenneth
Hello, I'm trying to get an Drupal with the Drupal CAS module to authenticate against an web2py app. When I test to go with browser to the user/cas/login adress on my site I get the following message: not authorized Can anyone explain how to get this working? How do I return some user

[web2py] Re: Google Cloud Storage in GAE refresh token access

2015-02-26 Thread Jacinto Parga
Well, I have made a little progress : https://developers.google.com/api-client-library/python/guide/google_app_engine#Credentials But, now the only question is how to get the modules: type 'exceptions.ImportError' No module named appengine.api El jueves, 26 de febrero de 2015, 8:48:46

[web2py] Function being called twice from one button click

2015-02-26 Thread peter
I have a baffling problem. I have written a ticket booking system for a jazz club, in Web2py. (Web2py has been great for this site). It has been functioning very well for a number of years. When reserving seats with the system, the user is shown a summary of their reservations and clicks a

Re: [web2py] pycharm python console

2015-02-26 Thread 'Diogene Laerce' via web2py-users
On 02/26/2015 01:41 PM, António Ramos wrote: To the ones that use pycharm with web2py. How can i interact with my models from the python console ? I don't think that it is different from the shell outside of pycharm. it does not recognize my models. What do you mean by that ? Regards, --

[web2py] Re: request.uri_language

2015-02-26 Thread Bas van Wetten
I realize this is an old thread but I was experiencing similar problems with web2py and it's custom language behavior. The problem is with the next assignment. The parameter passed to the 'read_possible_languages' function is not the correct path for the language files. possible_languages =

[web2py] DAL for Insert Into with Select

2015-02-26 Thread Mat Miles
Is it possible to use the DAL to run an INSERT INTO with a select list? I haven't figured out a way to make this work using db.executesql() because I need to pass a date to the query. I don't see a way to pass a variable into db.executesql(). -- Resources: - http://web2py.com -

Re: [Bulk] [web2py] Re: Use DAL as standalone

2015-02-26 Thread 'Diogene Laerce' via web2py-users
On 02/21/2015 12:56 AM, Cássio Botaro wrote: Do you clone the repository or use stable version? I dont have problems here running Version 2.9.12-stable+timestamp.2015.02.13.23.31.09 in linux ubuntu 14.04 But I do have some with the Web2py Version is

[web2py] Re: Use DAL as standalone

2015-02-26 Thread 'Diogene Laerce' via web2py-users
On 02/20/2015 10:05 PM, Michael Lam wrote: Massimo seems to had ported much of web2py components to other frameworks: https://github.com/mdipierro/gluino It hadn't seen updates since 2 years ago but it might serve as a starting point? Yeah.. But it seems a bit heavy just to benefit of

Re: [web2py] Re: Function being called twice from one button click

2015-02-26 Thread Carlos Costa
Use the browser console to investigate. Look at the Network tab if it performs two actions with that URL. Another thing that may sound stupid but it is not uncommon and I have already seen it. Some people double click buttons, icons in the web too. I saw a case that a delay between clicks was

[web2py] DePy 2015

2015-02-26 Thread Massimo Di Pierro
Hello everybody, I am happy to announce DePy 2015. A conference on Python hosted at DePaul on May 29 30. The conference will focus specifically on Data Analysis, Machine Learning and Web Development. No need to emphasize, there will be a heavy web2py component.

Re: [web2py] Reset Password Not Working in Production

2015-02-26 Thread Vinicius Assef
Which web2py version are you using? On Wed, 25 Feb 2015 13:19:31 -0300 Neil Oswald wrote Hi, Good day! After clicking the reset_password link I received from email, I got redirected to the homepage not on the reset password page. The strange thing is that this problem only

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Niphlod
it seems to me that there is database contention although the exception **should** be trapped (i.e. try to set the status to PICK, if not, well it's not a fatal error), there's something wrong with your setup or your database is too much underpowered to do what you're asking. How

[web2py] social networking share button to rss feed

2015-02-26 Thread Abhijit Chatterjee
Trting to put social networking share button to my rss feed. Any help? -- 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

Re: [web2py] pycharm python console

2015-02-26 Thread Tim Richardson
I use pycharm. Often I do some quick and dirty testing in a module file where I have code using DAL features. if __name__ == __main__: #debug code and I want to run that in the normal scope of web2py, i.e. the same as -S -M from the command line. I set up a Pycharm debug configuration which

[web2py] avatar like feature as in instant press

2015-02-26 Thread Abhijit Chatterjee
I m trying to put avatar like feature as in instant press. Any help? -- 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

[web2py] Re: avatar like feature as in instant press

2015-02-26 Thread Leonel Câmara
It's not very hard, here's a possibility that requires you to have pillow https://pillow.readthedocs.org/ installed. auth.settings.extra_fields['auth_user'] = [ Field('photo', 'upload', label=T('Photo'), uploadseparate=True, requires =[IS_EMPTY_OR(IS_IMAGE(error_message=T('This is not an

[web2py] Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Hello all, I keep getting this error when calling scheduler.queue_task() with immediate=True: class 'gluon.contrib.pymysql.err.InternalError' (1213, u'Deadlock found when trying to get lock; try restarting transaction') The stack trace shows this is the culprit:

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
Thanks for the quick response! I'm using Amazon RDS (just basically MySQL), on a pretty beefy instance (db.m3.large), 1000 IOPS. Would be pretty surprised if that were the problem. Running 5 scheduler workers with the default heartbeat (3s). On Thursday, February 26, 2015 at 3:35:41 PM UTC-8,

[web2py] Re: When not HTTPS i receive TypeError: 'NoneType' object is not callable

2015-02-26 Thread Massimo Di Pierro
At least three users have reported this problem with Apache. We need to set a time for a chat session and resolve this together since I cannot reproduce but I think I know the root cause. Can people make it on Monday at 10am CST? On Thursday, 26 February 2015 06:39:31 UTC-6, Leonel Câmara

[web2py] Re: Function being called twice from one button click

2015-02-26 Thread Massimo Di Pierro
Here is what would cause this problem. You have this link: {{=A('Confirm',_href=URL('reservation_confirmed', args=request.args),_style=color:#ff3300;font-size:20px;background-color:#ff;padding:5px;border:1px solid #99)}} Now if in the view for reservation_confirmed you include an

[web2py] Re: IRC Channel

2015-02-26 Thread Leonel Câmara
I think we pretty much just use this group. -- 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

[web2py] Re: Scheduler exception when setting immediate=True: 'Deadlock found when trying to get lock...'

2015-02-26 Thread Osman Masood
I was actually able to easily reproduce this. Just open up 2 web2py consoles (which connect to the same DB), and do: scheduler.queue_task('myfunc', pvars=dict(), immediate=True) The first one will succeed, and the second one will hang there for some time, and then give the deadlock exception

[web2py] Re: Change in application request.vars when switching from Rocket to Lighttpd+FastCGI

2015-02-26 Thread Mike
On Wednesday, February 25, 2015 at 12:18:29 PM UTC-8, Niphlod wrote: reaally strange, although I don't use lighttpd since nginx came out. request.vars are parsed out of request.QUERY_STRING. could you please doublecheck what request.get('QUERY_STRING') dumps ?

[web2py] IRC Channel

2015-02-26 Thread KPlus
Hello I Had a Quick Question Regarding Web2Py , I've looked for the fastest way to get a response from the community which is IRC Channel . But sadly , it looks inactive channel . is it #web2py on freenode ? or there are another channel ? Regards, -- Resources: - http://web2py.com -

[web2py] Customize incoming POST data

2015-02-26 Thread Jon M.
Greetings Web2Py fellows! While working with the DAL and some views I faced wall when I looked at the POST constructor from API. So the first question is simple. Is there any way to only catch a value from the POST constructor and do whatever I want inside the controller 'default.py' in order