[web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Anthony
On Wednesday, June 22, 2011 2:02:59 PM UTC-4, sheM wrote: > > @ Iceberg and Anthony... > > Thanks a lot for stopping by. > > > 1. return 'nothing' > and > 2. raise HTTP(403, errormsg) > > are 2 different types of returning responses again. > > - the requirement we got, doesn't really en

Re: [web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Anthony
I think pass will still return a response from web2py, but the body will be empty (none). On Wednesday, June 22, 2011 2:07:04 PM UTC-4, rochacbruno wrote: > did you tried 'pass' ? > > def index(): >if delay_time_for_responding=='infinite': >pass > > May be if the function is a web

Re: [web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Bruno Rocha
what if pass is as last statement? def index(): if something: return something elif otherthing: return otherthing elif delay_tima_for_responding == 'infinite': pass I did not tested, and I don t know if in this way web2py will redirect you to a 'genneric' respo

[web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread sheM
Yep :) pass will actually let me, still return responses that come after delay_time_for_responding=='infinite'. On Jun 22, 11:07 pm, Bruno Rocha wrote: > did you tried 'pass' ? > > def index(): >    if delay_time_for_responding=='infinite': >        pass > > May be if the function is a web serv

Re: [web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Bruno Rocha
did you tried 'pass' ? def index(): if delay_time_for_responding=='infinite': pass May be if the function is a web service you could get this more easily -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] [ Aprenda a programar: http://CursoDePython.com.br ] [ O seu aliado nos cu

[web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread sheM
@ Iceberg and Anthony... Thanks a lot for stopping by. 1. return 'nothing' and 2. raise HTTP(403, errormsg) are 2 different types of returning responses again. - the requirement we got, doesn't really encourage this :( any other suggestions pls? On Jun 22, 10:08 pm, Anthony wrote: >

[web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Anthony
Also, anywhere in your code (e.g., in a model file), you can test to see if the app should stop responding, and if so, raise the web2py HTTP error with a 4xx or 5xx status code. For example: if delay_time_for_responding=='infinite': raise HTTP(403) See http://web2py.com/book/default/chapt

[web2py] Re: Want to stop getting responses from web2py

2011-06-22 Thread Iceberg
What do you mean stop getting response? How about response with some "empty" stuff? Such as: def index(): if delay_time_for_responding=='infinite': return 'nothing' ... # normal code starts here Or if you really mean a response is suspended infinitely, you might need something cal