Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-19 Thread Paolo Valleri
I agree with Anthony's proposal, in a form these callbacks should be handled as validations are handled. By doing that, the user will return to the same form he/she filled. For a simple error message response.flash can be used. For more "in-form" messages, from my point of view, we should find a si

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-19 Thread Niphlod
def whateveryoumaycall(): content = fetch_the_resource() #set the correct headers, such as response.headers['Content-Type'] = 'blablabla' response.headers['Content-Length'] = 31298312098312 .. return content response.stream() accepts a file-like object, so you may do

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-19 Thread Manuele Pesenti
Il 19/08/14 09:27, Niphlod ha scritto: > from cStringIO import StringIO > def whateveryoumaycall(): > content = fetch_the_resource() > f = StringIO() > f.write(content) > f.seek(0) > #set the correct headers, such as > response.headers['Content-Type'] = 'blablabla' > re

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-19 Thread Niphlod
not really, except that it's not streamed. On Tuesday, August 19, 2014 10:12:55 AM UTC+2, Manuele wrote: > > Il 19/08/14 09:27, Niphlod ha scritto: > > from cStringIO import StringIO > > def whateveryoumaycall(): > > content = fetch_the_resource() > > f = StringIO() > > f.write(co

[web2py] sqlform.grid edit view back button

2014-08-19 Thread Yebach
Hello I have to create multiple sqlform.grids in my page i used bootstrap tabs to load different htmls with different controller functions (each for every grid) It works ok and does the trick except when I edit record I and click the back button the link is not back to the page it was so I can

[web2py] Re: Issue 1961; redirect, response.headers and CAS

2014-08-19 Thread Remco Boerma
http://www.html5rocks.com/en/tutorials/cors/ http://www.w3.org/TR/cors/ https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS This is what you look for i think, it's what i've used and offers a lof of info. Op woensdag 13 augustus 2014 20:07:21 UTC+2 schreef Massimo Di Pierro:

[web2py] Re: What am i doing wrong here? (virtualfields)

2014-08-19 Thread Remco Boerma
Op woensdag 13 augustus 2014 15:00:38 UTC+2 schreef Anthony: > > def new_style_virtual_field_test(): > > db = DAL('sqlite:memory',pool_size=1) >> db.define_table('myorder', >> Field('a','integer'), >> Field('b','integer') >> ) >> db.myorder.c = Field.Virtual(lambda

[web2py] Re: How to show just entered value in the same form after self-submitting?

2014-08-19 Thread Dragan Matic
Unfortunately that won't work, if you recreate the form it does not self-submit, in fact in that case submit button does nothing, try this - it won't work: form=SQLFORM.factory( Field('some_text', 'string')) if form.accepts(request): form=SQLFORM.factory

Re: [web2py] Re: How to show just entered value in the same form after self-submitting?

2014-08-19 Thread Richard Vézina
Maybe you want this : http://www.web2pyslices.com/slice/show/1616/widget-select-or-add-option-ng Or you can forge you own widget with tag-it : http://aehlke.github.io/tag-it/ Richard On Tue, Aug 19, 2014 at 8:07 AM, Dragan Matic wrote: > Unfortunately that won't work, if you recreate the for

[web2py] Re: How to show just entered value in the same form after self-submitting?

2014-08-19 Thread Anthony
On Thursday, August 14, 2014 6:16:02 PM UTC-4, Dragan Matic wrote: > > I have a form with two fields, one field is a selection box of previously > typed values and the other is a text box. User can choose a value from a > selection box or can type a value in text box and submit it in which case I

[web2py] Re: What am i doing wrong here? (virtualfields)

2014-08-19 Thread Anthony
Op woensdag 13 augustus 2014 15:00:38 UTC+2 schreef Anthony: > > def new_style_virtual_field_test(): >> >> db = DAL('sqlite:memory',pool_size=1) >>> db.define_table('myorder', >>> Field('a','integer'), >>> Field('b','integer') >>> ) >>> db.myorder.c = Field.Virtual(l

[web2py] Re: Shouldn't request.is_local be false when a web2py behind apache being accessed by remote client?

2014-08-19 Thread Ray (a.k.a. Iceberg)
On Monday, August 18, 2014 8:16:36 PM UTC-7, Ray (a.k.a. Iceberg) wrote: > > Hi web2py big family, > > I thought I had been using web2py for long enough but, still got stumbled > by this little issue. :-) > > I setup web2py behind apache (using the default setup script on > webfaction.com, if th

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-19 Thread Ray (a.k.a. Iceberg)
Streaming the output or not does not make much difference here, because your source code is designed to read ALL input first. That causes the response feeling slow. Not to mention this approach won't work at all when dealing with large content. A better way is to read a small amount of data and

[web2py] Re: sqlform.grid edit view back button

2014-08-19 Thread Niphlod
1. if you need multiple forms in one single page, you should use different formnames 2. you're loading the "fragment" not using LOAD (nor $.web2py.component), so links aren't trapped correctly Once you fix those, there shouldn't be any outstanding issues. On Tuesday, August 19, 2014 12:13:55 PM

Re: [web2py] Re: sqlform.grid edit view back button

2014-08-19 Thread Vid Ogris
How do I work with LOAD? 2014-08-19 21:06 GMT+02:00 Niphlod : > 1. if you need multiple forms in one single page, you should use different > formnames > 2. you're loading the "fragment" not using LOAD (nor $.web2py.component), > so links aren't trapped correctly > > Once you fix those, there sho

Re: [web2py] Re: sqlform.grid edit view back button

2014-08-19 Thread Niphlod
read it on the book (http://web2py.com/books/default/chapter/29/12/components-and-plugins) . Instead of loading tab fragments manually by javascript, you can let web2py facilities do it for you. On Tuesday, August 19, 2014 9:17:25 PM UTC+2, Yebach wrote: > > How do I work with LOAD? > > > 2014

[web2py] Re: Shouldn't request.is_local be false when a web2py behind apache being accessed by remote client?

2014-08-19 Thread Massimo Di Pierro
I think you are right. But there is a security issue. What if there is no proxy and the client sets the forwarded_for header to 127.0.0.1 to fake a local request? The thing is we should not assume a proxy. If you know you have a proxy you can set Request.client = False I am open to better sugg

[web2py] Bad url decode %2B

2014-08-19 Thread Roberto Perdomo
Hi everybody, I have a URL with a encoded string as first argument, when this string have a "+", web2py generate the URL with a "%2B", and when web2py go to read this argument, the "+" is converted to a underscore, the question is why?, this is ok? I can solve this using a form with the encoded s

[web2py] Re: Shouldn't request.is_local be false when a web2py behind apache being accessed by remote client?

2014-08-19 Thread Ray (a.k.a. Iceberg)
Suggest to put this 2 lines into the scaffold app's model.py: # Uncomment following line if you deploy your web2py behind a proxy # request.is_local = False -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.g

[web2py] Re: What am i doing wrong here? (virtualfields)

2014-08-19 Thread Remco Boerma
> I forgot this was changed -- now AttributeError exceptions in the virtual > fields function fail silently, simply foregoing the creation of the virtual > field value for the record (which is why you got no error but didn't see > the value in the record). > Gotcha, thanks! > > >> Inste

[web2py] Reload another component with new params

2014-08-19 Thread Manuele Pesenti
Hi! Is there a way to reload a LOAD component passing new parameters to it? Thanks Manuele -- 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 rece

[web2py] Re: Reload another component with new params

2014-08-19 Thread Niphlod
nope, you'd have to do it by hand using $.web2py.component On Wednesday, August 20, 2014 8:22:38 AM UTC+2, Manuele wrote: > > Hi! > Is there a way to reload a LOAD component passing new parameters to it? > > Thanks > > Manuele > -- Resources: - http://web2py.com - http://web2py.com/book