I’ve this function for search
@auth.requires_login()
def find_template():
form, rows=crud.search(db.templates,query=db.templates.active==True)
return dict(form=form, rows=rows)
it works fine, but the user is able to find his templates and the other templates of other users! (but he can’t edit them as i fixed this already)
so i put this
@auth.requires_login()
def find_template():
form, rows=crud.search(db.templates,query=[db.templates.active==True,
db.templates.user_id==auth.user_id])
return dict(form=form, rows=rows)
now the user can find nothing, it shows NONE or No Data
how can i fix this?
The
queryargument has to be in proper DAL query format, not a list of conditions. Try: