[web2py] form submit inconsistency.

2011-01-19 Thread annet
In a controller I have got the following form function: def create_form(): response.view='form.html' form=SQLFORM.factory( Field('bedrijfsnaam',length=54,requires=IS_NOT_EMPTY()), Field('kvk_nummer',length=8), Field('subdossiernummer',length=4,default=''),

[web2py] Re: .../default/user/not_authorized

2011-01-19 Thread annet
Massimo,     if isinstance(form,FORM):         form[0][-1][1].append(...) Thanks, a much better solution. Kind regards, Annet

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
I think there is another bug as well. The _unlock function only unlocks the session file if it exists but leaves response.session_file defined. Later when the request cycle finishes the _try_store_on_disk function will still see response.session_file as active and write it but this is now

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
Oh crud, I didn't see the self._forget state variable test at the front of _try-store_on_disk, sorry for the noise and response.session_file is a file object so having it go out of scope will close it. Ron

Re: [web2py] Re: How to pass a database object in request.vars to a function?

2011-01-19 Thread Johann Spies
Thanks for the pointer. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and

[web2py] Value of the form field

2011-01-19 Thread luifran
When I extract the value of a form field, if I've written for example take helmet, I get the value of field `take_helmet, why? The code is as follows: form = FORM ('name risk', INPUT (_name = 'name1', required = [IS_NOT_EMPTY (), IS_UPPER ()]), 'preventive

Re: [web2py] Value of the form field

2011-01-19 Thread Kenneth Lundström
If you look at form.vars.name1 before passing them via redirect you´ll see that no replacing has been done, try with if form.accepts (request.vars, session): session.flash = Form sent return form.vars.name1 the replacing happens in the redirect because you can´t have an URL with spaces

[web2py] Re: Value of the form field

2011-01-19 Thread luifran
Thanks, I fixed it with the next code: redirect(URL('modificar_obra',vars=dict(a=form.vars.nombre))) On 19 ene, 11:19, Kenneth Lundström kenneth.t.lundst...@gmail.com wrote: If you look at form.vars.name1 before passing them via redirect you ll see that no replacing has been done, try with if

[web2py] Re: social network idea

2011-01-19 Thread blackthorne
Maybe the bookmarking networks are considerably explored. Yet, most people don't even use the web for anything useful. All they want is already on Facebook galleries and those social networks. Bookmarking options are limited by its sources and most people sources are always the same, you just see

[web2py] Re: social network idea

2011-01-19 Thread blackthorne
Maybe the bookmarking networks are considerably explored. Yet, most people don't even use the web for anything useful. All they want is already on Facebook galleries and those social networks. Bookmarking options are limited by its sources and most people sources are always the same, you just see

[web2py] web2py website and 404's

2011-01-19 Thread Albert Abril
Just a suggestion. When I an incorrect url, for example: http://web2py.com/layout (instead of http://web2py.com/layouts) ...appears an invalid controller error, as it's expected. What if it instead is shown a nicer 404? Regards.

[web2py] Re: EAV Patterns

2011-01-19 Thread Adamski
Yes SQLAlchemy is exactly what I am looking for. Can anybody give me pointers in extending SQLFORM to automatically build crud forms from my sqlalchemy objects, I am using declarative_base to build my models. On Jan 13, 2:23 pm, Arun K.Rajeevan the1.a...@gmail.com wrote: May be you like

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
On Jan 18, 11:21 pm, Anthony abasta...@gmail.com wrote: Am I missing something? Yes. You're probably running web2py with the default number of threads (30 I think?). Your 2nd browser window's cookie is unlikely to get associated to the same thread. I have lots of users and when one thread

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
No, a cookie is associated with a session. Agreed. I'm pretty much using 'cookie', 'user', 'session', and 'browser' as interchangeable for my purposes. A cookie is associated to a session, but somehow a session is associated to a thread. Either that or I'm seeing some other effect for which I

Re: [web2py] Re: form / subform / adding row (field)...

2011-01-19 Thread Richard Vézina
;-) Originellement oui... I would tell you on the orther thread that I post this one... I will do it just for the one that fall on the orther thread so they could keep track... I continue today working on this. Richard On Wed, Jan 19, 2011 at 12:30 AM, mart msenecal...@gmail.com wrote: Hey,

Re: [web2py] Re: [off-topic] - Jquery Panels/dashboard Plugin

2011-01-19 Thread Richard Vézina
So usefull thread!! Thanks guys Richard On Tue, Jan 18, 2011 at 11:03 PM, Anthony abasta...@gmail.com wrote: On Tuesday, January 18, 2011 10:38:03 PM UTC-5, rochacbruno wrote: It has a 2.0 version http://www.trilancer.com/jpolite2/ Yeah, the version at http://www.web2py.com/jpolite is

[web2py] Re: form / subform / adding row (field)...

2011-01-19 Thread mart
Excellent! je prends le train, direction MTL, a tous les quelques mois pour me rendre au bureau (peut-etre un peu moins souvent l'hiver ;) ) SO, I have a question: Once, I use the button to add a field (which does work well), what should be the expected back-end result? does one of the tables get

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
On Jan 19, 9:17 am, Anthony abasta...@gmail.com wrote: On Wednesday, January 19, 2011 8:18:25 AM UTC-5, ae wrote: I have lots of users and when one thread takes a long time, some users can keep accessing controller functions and some can't.  Once the long- running controller finishes,

[web2py] Re: [off-topic] - Jquery Panels/dashboard Plugin

2011-01-19 Thread mart
Yeah, installed it last night too (I had always wondered what that was about, 'jPolite' - I thought it was for displaying images, because of the image of it on appliances :)). I think this could be the best kept secret... jpolite for pod like applications would be a great thing (and now i feel

[web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
Hmm, this sounds contrary to what Massimo and Jonathan have been saying. From their explanations, it sounds like user A should not be blocking user B (i.e., their requests should not be sharing a thread). On Wednesday, January 19, 2011 9:50:35 AM UTC-5, ae wrote: On Jan 19, 9:17 am,

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
On Jan 18, 11:21 pm, Anthony abasta...@gmail.com wrote: I tried this (the session.forget() version), and sayjunk is still being blocked for 30 seconds while waiting for blockme to finish (only when in the same browser -- I can load sayjunk in a different browser, which starts a different

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 1:35:09 AM UTC-5, Jonathan Lundell wrote: Actually, there's a bug in the documentation (or else in Session). You have to say: session.forget(response) or else the session doesn't get unlocked There are at least four occurrences of session.forget() in

Re: [web2py] Re: form / subform / adding row (field)...

2011-01-19 Thread Richard Vézina
For now only adding and removing city input. I clone city input retag id='city' to id='city2' for the first clone and so on. I change all the id attribute of other tag cloned like divs. I had a garbage can icon and make it mouseover. That it for now. Since I change the id of input to city2, city3

Re: [web2py] Re: form / subform / adding row (field)...

2011-01-19 Thread Richard Vézina
If you move the script into the layout.html in the head it still works... You can then remove the view /view/default/register.html_ So you get access to admin, request, session, response button to see what going. You can see that city2 vars is store in session for example. Richard On Wed, Jan

[web2py] Re: social network idea

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 6:54:05 AM UTC-5, blackthorne wrote: Oddly enough, I can't find a good code snippet network. GitHub and alikes made a great step with code sharing for full projects. You can search for projects not code snippets. There are many snippet managers that help you

[web2py] keepvalues=True and _type='reset'

2011-01-19 Thread annet
To temporarily solve the problem described in this post I added keepvalues=True, now when the records aren't inserted I just submit the form again, which somehow works. However, this causes the reset button to no longer work: def create_form(): response.view='form.html'

[web2py] shell and Web interface at the same time

2011-01-19 Thread Richard Vézina
Hello, Try to interact in shell and in the browser at the same time to test form input... Is it possible to start web2py in both mode at the same time?? Or is there a way to insert form input in shell mode? Thanks Richard

[web2py] Re: WARNING:root:failure to stat applications

2011-01-19 Thread Massimo Di Pierro
Please upgrade. 1.91.4 has known bugs. If you still have the problem, we will look furtherinot this. On Jan 18, 9:59 pm, Rupesh Pradhan rupeshkrprad...@gmail.com wrote: My Computer Configuration: CPU: Intel Motheboard: ASUS OS: Windows XP Profession, SP2 Web2Py version: 1.91.4 (2010-12-22)

[web2py] Re: Shell controllers views

2011-01-19 Thread Massimo Di Pierro
No. You can only access the models. On Jan 19, 12:31 am, walter wdv...@gmail.com wrote: Question about a shell. Can I interact to controllers and views as easy as a DB? If it is true, how?

[web2py] Re: - Jquery Panels/dashboard Plugin

2011-01-19 Thread Massimo Di Pierro
Mind that is a veyr old app that uses something called jDiv which later evolved into LOAD. It should be rewritten using jpolite 2 and LOAD. On Jan 18, 6:21 pm, Anthony abasta...@gmail.com wrote: Probably not quite what you're looking for, but maybe this could help:http://www.web2py.com/jpolite

[web2py] Re: shell and Web interface at the same time

2011-01-19 Thread Massimo Di Pierro
Both may lock the DB in sqlite. That is the only problem I can think of. On Jan 19, 9:45 am, Richard Vézina ml.richard.vez...@gmail.com wrote: Hello, Try to interact in shell and in the browser at the same time to test form input... Is it possible to start web2py in both mode at the same

Re: [web2py] Re: shell and Web interface at the same time

2011-01-19 Thread Richard Vézina
Can't find the exast bash command to do it. (I have postgres) With : python web2py.py -a 'asdf' -i 127.0.0.1 -p 8001 -S appname -M auto' I got the ipython, but when I go to 127.0.0.1:8001 nothing... Richard On Wed, Jan 19, 2011 at 11:03 AM, Massimo Di Pierro massimo.dipie...@gmail.com wrote:

Re: [web2py] Re: shell and Web interface at the same time

2011-01-19 Thread Bruno Rocha
Richard, python web2py.py -a 'asdf' -i 127.0.0.1 -p 8001 -S appname -M auto' Starts only web2py interactive shell mode, not the webserver. You have to open 2 consoles in the first you do: python web2py.py -S appname -M -P in second you do: python web2py.py -a 'asdf' -i 127.0.0.1 -p 8001'

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 6:50 AM, ae wrote: On Jan 19, 9:17 am, Anthony abasta...@gmail.com wrote: On Wednesday, January 19, 2011 8:18:25 AM UTC-5, ae wrote: I have lots of users and when one thread takes a long time, some users can keep accessing controller functions and some can't. Once

Re: [web2py] web2py website and 404's

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 3:55 AM, Albert Abril wrote: Just a suggestion. When I an incorrect url, for example: http://web2py.com/layout (instead of http://web2py.com/layouts) ...appears an invalid controller error, as it's expected. What if it instead is shown a nicer 404? Right now

Re: [web2py] Re: shell and Web interface at the same time

2011-01-19 Thread Richard Vézina
Then I will be able to request.vars? I go test. Richard On Wed, Jan 19, 2011 at 11:37 AM, Bruno Rocha rochacbr...@gmail.com wrote: Richard, python web2py.py -a 'asdf' -i 127.0.0.1 -p 8001 -S appname -M auto' Starts only web2py interactive shell mode, not the webserver. You have to open

Re: [web2py] Re: Shell controllers views

2011-01-19 Thread Bruno Rocha
2011/1/19 Massimo Di Pierro massimo.dipie...@gmail.com No. You can only access the models. I wonder if it is possible to start web2py in Shell mode, execute a controller under the web2py environment. inspect the controllers 'return' or use template.py to evaluate a view file passing the

[web2py] plugin_wiki widget jqgrid: colnames or columns?

2011-01-19 Thread blackthorne
The way you define the column names in the Jqgrid plugin is done, according to the book, with the columns attribute is a list of columns names to be displayed. However, in the plugin_wiki widget builder interface that is done with the attribute colnames. In the code plugin_wiki controller, the

Re: [web2py] Re: shell and Web interface at the same time

2011-01-19 Thread Richard Vézina
Nop! In [2]: request.vars Out[2]: Storage {} Samething with plain python shell (-P option) Richard On Wed, Jan 19, 2011 at 11:46 AM, Richard Vézina ml.richard.vez...@gmail.com wrote: Then I will be able to request.vars? I go test. Richard On Wed, Jan 19, 2011 at 11:37 AM, Bruno

Re: [web2py] Re: Shell controllers views

2011-01-19 Thread howesc
hmmm, something say like: def unittests(): test the ability to run unittests import os import sys import glob import cStringIO from gluon.shell import env #save stdout so we can capture data and reset it. stdout = sys.stdout stderr = sys.stderr

[web2py] Re: web2py website and 404's

2011-01-19 Thread VP
It's definitely nicer (more professional) to have a customized page for invalid request.

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
If the response is left off the session.forget() parameter list it defaults to None. The end result then is the session._forget state variable is set True but the session file is not unlocked in the _unlock function. This would enhance performance by bypassing the writing of the session file at

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
So, I guess the question is, what should the book (and the 'call' function in the scaffolding app) be recommending, session.forget() or session.forget(response)? At the very least, the difference between the two should be explained in the book. On Wednesday, January 19, 2011 1:26:06 PM UTC-5,

[web2py] Re: WARNING:root:failure to stat applications

2011-01-19 Thread Rupesh Pradhan
Ok. Thanks for the response. On Jan 19, 8:59 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Please upgrade. 1.91.4 has known bugs. If you still have the problem, we will look furtherinot this. On Jan 18, 9:59 pm, Rupesh Pradhan rupeshkrprad...@gmail.com wrote: My Computer

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 10:26 AM, ron_m wrote: If the response is left off the session.forget() parameter list it defaults to None. The end result then is the session._forget state variable is set True but the session file is not unlocked in the _unlock function. This would enhance performance

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread VP
UPDATE: I am able to reproduce this Premature end of script headers: wsgihandler.py error with a slightly modified app based on the image blog in the web2py book. I modified it so that images are shown in the index page, instead of having just the titles listed. Testing using: ab -kc 100 -t 20

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
I remember session.forget() documented as a performance enhancement - no plans to alter session on this call, do this to save the write. I think this would be the most common use. Adding the response parameter to unlock the session file is only required if there is a need for concurrency in the

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 10:32 AM, Anthony wrote: So, I guess the question is, what should the book (and the 'call' function in the scaffolding app) be recommending, session.forget() or session.forget(response)? At the very least, the difference between the two should be explained in the book.

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
I saw that too last night but it was late. It would be better to set response.session_file to None which will force a file close since the file object goes out of scope. Adding a del in _unlock will cause AttributeError in the _try_store_on_disk when the request-response cycle is finishing up.

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread VP
What is curious is that RAM is still available, with this error. Monitoring CPU (using top) shows CPU % is about 70% for apache2 (70% is probably capped by my VPS host, given to each VPS slice). And this occurs for a very simple app. I hope Massimo or someone else can reproduce this error with

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread VP
I forgot to mention that in this imageblog app, I only have 10 images, and no comment. I.e. a very small database. Here are the 10 images: http://imgur.com/u6gwulkJNwjDsjQxHIIN99AqEII5Pvh1gxagEcoJru2ucY3583C

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
It would be better to set response.session_file to None in _unlock because the second _unlock call will generate an AttributeError when testing for response.session_file at the top of _unlock.

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 10:52 AM, ron_m wrote: I saw that too last night but it was late. It would be better to set response.session_file to None which will force a file close since the file object goes out of scope. Adding a del in _unlock will cause AttributeError in the _try_store_on_disk

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
There is another subtle problem. If the file close is not done after the unlock which is how it works now then the file is still open. It is not possible to get the exclusive lock in session.connect() until the file is closed so the second request remains blocked.

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 11:06 AM, ron_m wrote: There is another subtle problem. If the file close is not done after the unlock which is how it works now then the file is still open. It is not possible to get the exclusive lock in session.connect() until the file is closed so the second request

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
On Jan 19, 10:14 am, ae ae88...@gmail.com wrote: Well, maybe not.  I just downloaded 1.91.6 and I couldn't replicate the behavior.  We use 1.67.1 in production and what I tested on might have been even older than that. So I'm back to not sure again. When I tested earlier I used the --

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
Maybe it is a Windows only issue, I was reviewing the flock(2) man page and it isn't a problem in UNIX systems. I haven't looked at the Windows docs but remember file access is more restrictive on that system. For now it is only a suspicion, I don't use Windows so would have to do a lot to test

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread Massimo Di Pierro
Thanks this is very helpful and I will try reproduce it. Are you running the trunk version or which other version? Massimo On Jan 19, 12:45 pm, VP vtp2...@gmail.com wrote: UPDATE:  I am able to reproduce this Premature end of script headers: wsgihandler.py error with a slightly modified app

[web2py] Re: Long-running controllers

2011-01-19 Thread Massimo Di Pierro
Good catch. Thanks Jonathan. On Jan 19, 12:45 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jan 19, 2011, at 10:26 AM, ron_m wrote: If the response is left off the session.forget() parameter list it defaults to None. The end result then is the session._forget state variable is set

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread Michael Toomim
Yes, this echos my experiences exactly! Using apache ab benchmark alone would NOT trigger the error. I had plenty of RAM available. Seems to be a concurrency bug. On Jan 19, 10:53 am, VP vtp2...@gmail.com wrote: What is curious is that RAM is still available, with this error. Monitoring CPU

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 11:23 AM, ron_m wrote: Maybe it is a Windows only issue, I was reviewing the flock(2) man page and it isn't a problem in UNIX systems. I haven't looked at the Windows docs but remember file access is more restrictive on that system. For now it is only a suspicion, I

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 2:33:55 PM UTC-5, Jonathan Lundell wrote: On Jan 19, 2011, at 11:23 AM, ron_m wrote: Maybe it is a Windows only issue, I was reviewing the flock(2) man page and it isn't a problem in UNIX systems. I haven't looked at the Windows docs but remember file access

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
--maxthreads does nothing if you don't specify --minthreads, so that should be fixed one way or another. I don't know if that problem is in web2py or Rocket.

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
Now that I think about it, it seems likely that somewhere something's doing: if maxthreads minthreads: maxthreads = minthreads On Jan 19, 2:48 pm, ae ae88...@gmail.com wrote: --maxthreads does nothing if you don't specify --minthreads, so that should be fixed one way or another.  I don't

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread VP
I am running the official version 1.91.6. On Jan 19, 1:24 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Thanks this is very helpful and I will try reproduce it. Are you running the trunk version or which other version? Massimo On Jan 19, 12:45 pm, VP vtp2...@gmail.com wrote:

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 11:43 AM, Anthony wrote: On Wednesday, January 19, 2011 2:33:55 PM UTC-5, Jonathan Lundell wrote: On Jan 19, 2011, at 11:23 AM, ron_m wrote: Maybe it is a Windows only issue, I was reviewing the flock(2) man page and it isn't a problem in UNIX systems. I haven't looked

[web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 2:51:25 PM UTC-5, ae wrote: Now that I think about it, it seems likely that somewhere something's doing: if maxthreads minthreads: maxthreads = minthreads I'm not sure about that, but I found this great Monty Python reference while looking into

[web2py] Re: Apache, Wsgi problem

2011-01-19 Thread VP
It seems the links to the images don't work anymore. You can just picked any 10 images, but again the ones I used are: http://i.imgur.com/u6gwu.jpg http://i.imgur.com/kJNwj.jpg http://i.imgur.com/DsjQx.jpg http://i.imgur.com/HIIN9.jpg http://i.imgur.com/9AqEI.jpg http://i.imgur.com/I5Pvh.jpg

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 2:58:33 PM UTC-5, Jonathan Lundell wrote: Also, I notice the command line options section of the book ( http://web2py.com/book/default/chapter/04?search=shell#Command-Line-Options) still refers to the --numthreads option -- should that be replaced with the

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 11:48 AM, ae wrote: --maxthreads does nothing if you don't specify --minthreads, so that should be fixed one way or another. I don't know if that problem is in web2py or Rocket. I can't find a problem. How did it present itself? One thing to keep in mind is that the

Re: [web2py] Re: Shell controllers views

2011-01-19 Thread Anthony
Would exec_environment() be useful here: http://web2py.com/book/default/chapter/04#Execution-Environment On Wednesday, January 19, 2011 11:47:26 AM UTC-5, rochacbruno wrote: 2011/1/19 Massimo Di Pierro massimo@gmail.com No. You can only access the models. I wonder if it is possible

Re: [web2py] Re: Shell controllers views

2011-01-19 Thread Bruno Rocha
So, the answer is YES, you can interact with controllers within the shell, I think web2py could have some helper to wrap that. file '/controllers/default.py' def sum(): n = request.vars.num return 1+n /file shell from gluon.shell import exec_environment request.vars Storage {}

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
I was talking about the _unlock call at the top of _try_store_on_disk def _try_store_on_disk(self, request, response): if not hasattr(os,'mkdir'): return if response._dbtable_and_field \ or not response.session_id \ or self._forget:

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
I think the default minimum is 8 and it seems there are 3 other 'overhead' threads. (if I just start web2py without any thread options, ps shows 11 threads.) If I do --maxthreads=2, I get 11 threads total. If I do --minthreads=2 --maxthreads=2, I get 5 total (3 + 2?) So, since the default is 8

Re: [web2py] Re: Shell controllers views

2011-01-19 Thread Bruno Rocha
Simply: exec_environment('applications/welcome/controllers/default.py',request=request).sum() 5 Bruno Rocha http://about.me/rochacbruno/bio

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 12:32 PM, ron_m wrote: I was talking about the _unlock call at the top of _try_store_on_disk def _try_store_on_disk(self, request, response): if not hasattr(os,'mkdir'): return if response._dbtable_and_field \ or not

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 12:32 PM, ae wrote: I think the default minimum is 8 and it seems there are 3 other 'overhead' threads. (if I just start web2py without any thread options, ps shows 11 threads.) The default minimum is 10 (set in Rocket). I think you're seeing the main thread plus the 10

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread ron_m
Okay, I get it, Storage id a dict but adds a __getattr__ which returns None on missing key. Nothing like learning in public -- blush.

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
I can say that using two different browsers (FF Chrome) from the same host does not exhibit the same behavior as two tabs/windows from the same browser (same profile...). On Jan 19, 1:46 pm, ron_m ron.mco...@gmail.com wrote: I remember session.forget() documented as a performance enhancement -

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 12:49 PM, ae wrote: I can say that using two different browsers (FF Chrome) from the same host does not exhibit the same behavior as two tabs/windows from the same browser (same profile...). Yes, that's expected. Browsers don't share their cookie jars, so there's no way

[web2py] Re: Use the source, Luca

2011-01-19 Thread mikech
This would be a great contribution.

[web2py] Re: web2py and external editors

2011-01-19 Thread Niphlod
never tried but 2 possibilities arise: - put all imports in the head of the code I personally use tips from http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html (search the section starting with Avoiding warning and errors with Pydev) with a few variations - explore the

[web2py] Re: Long-running controllers

2011-01-19 Thread ae
I understand getting a different session is expected. I'm talking about different behavior in how requests are dispatched to threads. The above scenarios for example which leads me to believe you can't reliably use long running functions.

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 1:45 PM, ae wrote: I understand getting a different session is expected. I'm talking about different behavior in how requests are dispatched to threads. The above scenarios for example which leads me to believe you can't reliably use long running functions. Again, it's

[web2py] Re: Use the source, Luca

2011-01-19 Thread Anthony
On Wednesday, January 19, 2011 1:14:28 AM UTC-5, cjrh wrote: There was a malfunction on my link to the module-level documentation that I was referring to (curse you Frames): first go here: http://www.web2py.com/examples/static/epydoc/index.html And then click on web2py.gluon.dal on the

[web2py] Cached Results Using a Module.

2011-01-19 Thread David J.
Perhaps I missed an important point; I have an api.py which I loaded through the modules directory; This api.py makes calls for data to external web services; In my controller; I have api = local_import('api') def remote(): api_result = api.xml_request({'id':'123456'}) return

[web2py] Re: Cached Results Using a Module.

2011-01-19 Thread ron_m
If you are editing the file in the modules directory then that is the problem. A module gets pulled in and kept by the server until restart unless you add a parameter to the local_import() api = local_import('api', True) where the True says perform a module reload on each request.

Re: [web2py] Re: Cached Results Using a Module.

2011-01-19 Thread David J.
Great Thanks I will try; At what cost am I doing this; Does it add tremendous overhead? Thanks On 1/19/11 5:24 PM, ron_m wrote: If you are editing the file in the modules directory then that is the problem. A module gets pulled in and kept by the server until restart unless you add a

[web2py] Re: Cached Results Using a Module.

2011-01-19 Thread Massimo Di Pierro
Yes. In production set the second argument to False On Jan 19, 4:27 pm, David J. da...@styleflare.com wrote: Great Thanks I will try; At what cost am I doing this; Does it add tremendous overhead? Thanks On 1/19/11 5:24 PM, ron_m wrote: If you are editing the file in the modules

Re: [web2py] Re: Cached Results Using a Module.

2011-01-19 Thread David J.
As you said; It worked; Thanks for the pointer; I appreciate it; And will set to false in production. Thanks again. On 1/19/11 5:27 PM, Massimo Di Pierro wrote: Yes. In production set the second argument to False On Jan 19, 4:27 pm, David J.da...@styleflare.com wrote: Great Thanks I

Re: [web2py] Re: Cached Results Using a Module.

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 2:32 PM, David J. wrote: As you said; It worked; Thanks for the pointer; I appreciate it; And will set to false in production. I define a PRODUCTION flag in my model, and use it for this purpose as well as setting different log levels and cache durations. Thanks

Re: [web2py] Re: Long-running controllers

2011-01-19 Thread Jonathan Lundell
On Jan 19, 2011, at 7:15 AM, Anthony wrote: On Wednesday, January 19, 2011 1:35:09 AM UTC-5, Jonathan Lundell wrote: Actually, there's a bug in the documentation (or else in Session). You have to say: session.forget(response) or else the session doesn't get unlocked There are at

[web2py] JSON Data

2011-01-19 Thread contatogilson...@gmail.com
Hello guys, I'm wanting an action returns a json like this: { start: 2011-01-27, id: 4, title: Fulano Silva } Only to send to the view he is being rendered thus: quot;{\n \quot;start\quot;: \quot;2011-01-27\quot;, \n \quot;id\quot;: 4, \n \quot;title\quot;: \quot;Fulano

[web2py] Re: web2pyslices migration

2011-01-19 Thread Plumo
wow - sounds fantastic!

[web2py] Re: web2py and external editors

2011-01-19 Thread Plumo
I use Komodo Edit, and to deal with the imports I made a plugin that executed this implicitly in every Python file: if 0: from gluon.globals import * from gluon.html import * from gluon.http import * from gluon.sqlhtml import SQLFORM, SQLTABLE, form_factory session =

[web2py] Re: web2py website and 404's

2011-01-19 Thread Matt
Could this be configurable? I.e. have a setting in the router to specify if we want a 400 or 404 when this occurs? Matt On Jan 20, 5:43 am, Jonathan Lundell jlund...@pobox.com wrote: On Jan 19, 2011, at 3:55 AM, Albert Abril wrote: Just a suggestion. When I an incorrect url, for example:

[web2py] Re: geo spatial GIS in web2py

2011-01-19 Thread KK
Anything? This is very discouraging. How about this? Would it be possible to run geodjango and web2py on the same server? I'd like my main site to be served by web2py. Then provide a link on the webpage to http://mysite/geospatial/, at which point geodjango takes over and starts serving

[web2py] Re: geo spatial GIS in web2py

2011-01-19 Thread Massimo Di Pierro
One year ago a user (do not recall his name) implemented something like geodjango in web2py dal. This was a master thesis project. He was not my student but I have the code somewhere.It was never merged to trunk because the patch was for a very old version of web2py. There is also this:

[web2py] error with mod_wsgi on shared host

2011-01-19 Thread Cory Coager
This is a new setup of web2py using mod_wsgi on a shared host. Any idea what is wrong? .htaccess: SetHandler wsgi-script Options +ExecCGI RewriteEngine On RewriteRule ^((static|auth|admin|mycontroller).*)$ /wsgihandler.py/ myapp/$1 [QSA,PT,L] Error logs: [Wed Jan 19 17:52:06 2011] [error]

[web2py] Re: Cached Results Using a Module.

2011-01-19 Thread cjrh
On Jan 20, 12:39 am, Jonathan Lundell jlund...@pobox.com wrote: I define a PRODUCTION flag in my model, and use it for this purpose as well as setting different log levels and cache durations. And for migration support, I'm guessing. I do the same thing.

  1   2   >