[web2py] Re: pass arguments to menu item

2017-01-26 Thread Andrea Fae'
You are great! Thank you very much. Il giorno giovedì 26 gennaio 2017 01:06:48 UTC+1, Leonel Câmara ha scritto: > > Yes, I'm sorry Andrea, I don't use the grid much nowadays, that's because > you're using request.args(0) and the grid also uses args, when it sees your > arg it thinks it should be

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Leonel Câmara
Yes, I'm sorry Andrea, I don't use the grid much nowadays, that's because you're using request.args(0) and the grid also uses args, when it sees your arg it think it should be a signature and so you get not authorized, so, I think you need to send your "arg" to the grid so it knows it's yours an

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Andrea Fae'
Thanks a lot, but nevertheless it's not working. flash tell me I'm not authorized The function modified is this def lista_asset(): if (request.args(0) == 'SC'): query = (db.asset.tipo=='SC') & (db.asset.is_active==True) else: query = (db.asset.is_active==True) db.a

Re: [web2py] Re: pass arguments to menu item

2017-01-25 Thread Áureo Dias Neto
Thanks bro, it's really usefull \o 2017-01-25 15:23 GMT-02:00 Leonel Câmara : > The first one: > > *db(*(db.asset.tipo=='SC') & (db.asset.is_active==True)*)* > > Returns a Set (this is not a python set but a pyDAL one) > > The second one: > > (db.asset.tipo=='SC') & (db.asset.is_active==True) > >

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Leonel Câmara
The first one: *db(*(db.asset.tipo=='SC') & (db.asset.is_active==True)*)* Returns a Set (this is not a python set but a pyDAL one) The second one: (db.asset.tipo=='SC') & (db.asset.is_active==True) Actually returns a Query A set is what you get when you call your DAL instance with a query as

Re: [web2py] Re: pass arguments to menu item

2017-01-25 Thread Áureo Dias Neto
Leonel, can explain the difference between two codes? 2017-01-25 15:12 GMT-02:00 Leonel Câmara : > Note that this isn't a query: > > query = db((db.asset.tipo=='SC') & (db.asset.is_active==True)) > > this is a query: > > query = (db.asset.tipo=='SC') & (db.asset.is_active==True) > > -- > Resource

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Leonel Câmara
Note that this isn't a query: query = db((db.asset.tipo=='SC') & (db.asset.is_active==True)) this is a query: query = (db.asset.tipo=='SC') & (db.asset.is_active==True) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Andrea Fae'
Thanks but it's not the question. I wanted to pass some arguments to function like this... ('Scanner operativi', False, URL('default', 'lista_asset', *args='SC*')), but when I use in the function the system told me in session.flash "Not authorized" and doesn't show me what I want...

[web2py] Re: pass arguments to menu item

2017-01-25 Thread Leonel Câmara
What do you mean? The menu is usually defined in the menu.py model, which puts the menu in response.menu. You can either change the model file to change the menu depending on "arguments" or you can change response.menu in the controller where you want it changed. -- Resources: - http://web2py