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.asset.datadismissione.readable = False
grid = SQLFORM.grid(query,
fields=[db.asset.seriale,db.asset.nome,db.asset.uo], details=False,
create=False, editable=False, deletable=False, maxtextlength=40)
return locals()
Il giorno mercoledì 25 gennaio 2017 18:23:58 UTC+1, Leonel Câmara ha
scritto:
>
> 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
> argument.
>
> The Grid is actually expecting a query because it can do more than one
> call to the DAL with that same query to get different things.
>
> See:
> https://github.com/web2py/pydal/blob/master/pydal/objects.py
>
>
>
--
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 the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.