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
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
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
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)
>
>
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
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
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)
-
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...
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
9 matches
Mail list logo