Re: [web2py] request.args(0) vs request.args[0]

2017-11-30 Thread Yoel Benitez Fonseca
thnks a lot 2017-11-30 6:36 GMT-05:00 Anthony : > Note, request.args is an instance of the gluon.storage.List class. It has a > __call__ method, so in addition to acting like a standard Python list, it > can be called like a function. > > Anthony > > > On Wednesday, November 29, 2017 at 7:10:19 PM

Re: [web2py] request.args(0) vs request.args[0]

2017-11-30 Thread Anthony
Note, request.args is an instance of the gluon.storage.List class. It has a __call__ method, so in addition to acting like a standard Python list, it can be called like a function. Anthony O

Re: [web2py] request.args(0) vs request.args[0]

2017-11-29 Thread Dave S
On Wednesday, November 29, 2017 at 8:19:57 AM UTC-8, Massimiliano wrote: > > Try it without passing the args > > def test(): > print request.args(0) #return None > print request.args[0] #fail > > That's "fail" as in "ticket issued", because of array bounds error. Also, on the grammar le

Re: [web2py] request.args(0) vs request.args[0]

2017-11-29 Thread Anthony
Also, request.args() takes some additional arguments: requests.args(0, default=some_default, cast=int, otherwise= a_function_or_redirect_url) Anthony On Wednesday, November 29, 2017 at 11:19:57 AM UTC-5, Massimiliano wrote: > > Try it without passing the args > > def test(): > print request.

Re: [web2py] request.args(0) vs request.args[0]

2017-11-29 Thread Massimiliano
Try it without passing the args def test(): print request.args(0) #return None print request.args[0] #fail On Wed, Nov 29, 2017 at 5:16 PM, Yoel Benitez Fonseca wrote: > ¿What is the diff? > > -- > Msc. Yoel Benítez Fonseca > > -- > Resources: > - http://web2py.com > - http://web2py.com

[web2py] request.args(0) vs request.args[0]

2017-11-29 Thread Yoel Benitez Fonseca
¿What is the diff? -- Msc. Yoel Benítez Fonseca -- 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

Re: [web2py] request.args encoding

2016-07-27 Thread Martin Weissenboeck
Try URL('action', vars=dict(arg0='a#b', arg1='a:b')) Am 27.07.2016 14:33 schrieb "Mirek Zvolský" : > > If I use > URL('action', args=("a#b", "a:b")) > > I will receive > request.args == ['a_b', 'a_b'] > > So I need to use something like base64.b32encode() for each one item from args. > > > Probabl

[web2py] request.args encoding

2016-07-27 Thread Mirek Zvolský
If I use URL('action', args=("a#b", "a:b")) I will receive request.args == ['a_b', 'a_b'] So I need to use something like base64.b32encode() for each one item from args. Probably this is "by design" behaviour, but I'm curious why is it so? urllib.quote / .unqoute returns the original value a#

[web2py] request.args and special character

2016-05-24 Thread Ivan Gazzola
I've tried an URI like this "app/controller/function/1%C2%B0%20Classe" for sending the "1° Classe" value If in my function i call request.args(0) I get "1__Classe" If I call request.url.split('/')[-1] I get "1° Classe" Why? I've tried to find the source code for args assignment but I can'

[web2py] request.args

2016-01-17 Thread goome
i have this url : http://127.0.0.1:8000/PROVE/dettaglio_aggiornamenti/SPE/SPE_2016011518051300.csv generated by: href="{{=URL(r=request,f='dettaglio_aggiornamenti',args=['SPE',ultimoFileSpe])}} i believed that request.args[0] == 'SPE' and request.args[1]== 'SPE_2016011518051300.csv' but i got

[web2py] request.args and request.args[-3] == 'view':

2015-11-19 Thread Gael Princivalle
Hello all. With a grid I use a custom single record view. So in my view I have this test: if request.args and request.args[-3] == 'view': for displaying the custom single record view. But when I click on the add record button I have this error: list index out of range Is there a way to use a

[web2py] request.args return __(double underscore) instead of proper unicode character ??

2015-02-19 Thread Mirek Zvolský
I have problem with unicode characters in url in request.args. Most resources recommend to use the percent encoding. http://stackoverflow.com/questions/2742852/unicode-characters-in-urls Example: http://www.utf8-chartable.de/unicode-utf8-table.pl?start=256&unicodeinhtml=hex&htmlent=1 U+0

Re: [web2py] request.args always empty...

2013-01-10 Thread Jonathan Lundell
On 10 Jan 2013, at 10:34 AM, Kic wrote: > Dear community, > > I have a strange problem reading in request.args . > I was trying to implement the mechanism from the web2py book, chapter 29, > SQLFORM.grid where it says: > > def manage(): > table = request.args(0) > if not table in db.tab

[web2py] request.args always empty...

2013-01-10 Thread Kic
Dear community, I have a strange problem reading in request.args . I was trying to implement the mechanism from the web2py book, chapter 29, SQLFORM.grid where it says: def manage(): table = request.args(0) if not table in db.tables(): redirect(URL('error')) grid = SQLFORM.grid(db[ta

Re: [web2py] request.args returns each arg as string

2012-02-13 Thread Bruno Rocha
in the second example the DAL query operator == is taking care of trying to convert your data to the right type. http://zerp.ly/rochacbruno Em 14/02/2012 05:14, "Annet" escreveu: > I posted a question asking why this doesn't work: > > if request.args(0)==1 > > the answer: request.args returns ea

[web2py] request.args returns each arg as string

2012-02-13 Thread Annet
I posted a question asking why this doesn't work: if request.args(0)==1 the answer: request.args returns each arg as string However, in my application I use this multiple times: rows=db(db.node.id==request.args(0)).select(db.node.ALL) where id is of type integer and not string. What is the dif

[web2py] request.args returns each arg as string

2012-02-13 Thread Annet
I posted a question asking why this doesn't work: if request.args(0)==1 the answer: request.args returns each arg as string However, in my application I use this multiple times: rows=db(db.node.id==request.args(0)).select(db.node.ALL) where id is of type integer and not string. What is the dif

[web2py] request.args[1] formats white spaces

2011-09-29 Thread Vineet
I am using request.args[1] in a custom built form (not FORM helper). [CODE] Department [/CODE] The original argument is like this: "human Resources department" It gets formatted like this : "human_Resources_department" If a FORM helper is used, this formatting is avoided. How do I get t

[web2py] request.args inconsistent behaviour and ignoring URI valid characters

2011-09-05 Thread pbreit
It's hard to say exactly what is allowed but according to my reading of http://tools.ietf.org/html/rfc3986 * is definitely not allowed and . and .. may not be allowed in the path (since they have meaning in a file system).

[web2py] request.args inconsistent behaviour and ignoring URI valid characters

2011-09-05 Thread Noel Villamor
I am trying to pass a '.' and a '*' as parameters to a controller function. controller: test.py def t(): arr = request.args return 'alert("%s");' % repr(arr) url: /myapp/test/t/1/2/3 alert: ['1', '2', '3'] With one dot in between 1 and 3 url: /myapp/test/t/1/./3 alert: ['1', '3'] With t

Re: [web2py] request.args error on module

2011-04-13 Thread Stifan Kristi
a, i c, got it, thank you so much for your advised. best regards, steve van christie

Re: [web2py] request.args error on module

2011-04-13 Thread pbreit
Models. You may have seen in the "welcome" app that there is a file "menus.py" in the "models" folder.

Re: [web2py] request.args error on module

2011-04-13 Thread Stifan Kristi
a, i c, it's open my mind, thank you so much for your advised. i'll try to follow your advised. which is better to put the menu functionality that been used by many views (same code in many views, the link is related with database (request.args))? thank you so much in advance. best regards, stev

Re: [web2py] request.args error on module

2011-04-13 Thread pbreit
If used by one controller, put in controller. If used by multiple controllers, put in models. If has little or no access to the DB or other Web2py global functionality, put in module. In theory there is a minor performance hit in adding code to models since all models are loaded on every call. B

Re: [web2py] request.args error on module

2011-04-13 Thread Stifan Kristi
thank you so much for your advice. what is the difference between put it on the models folder, controllers folder and modules folder? i mean in performance, or maybe syntax thank you so much and best regards, steve van christie On 2011-04-13, pbreit wrote: > I usually just put those functions i

[web2py] request.args error on module

2011-04-12 Thread pbreit
I usually just put those functions in the models folder. Much easier. I would highly recommend trying to keep things simple.

[web2py] request.args error on module

2011-04-12 Thread 黄祥
hi all, i have a lot of code that used by another controller: e.g. def show(): page = db.author(request.args(0)) or redirect(URL('index')) return dict(page = page) so, i plan to use a module that contain repeated def function: e.g. module : def show(request, db): page =