Hi I think I took this code from one of massimos tutorial videos:
def recipes():
try:
failtrial=int(request.vars.category)
rows=db(db.recipes.category==request.vars.category).select(orderby=~
db.recipes.submitted)
except:
rows=db().select(db.recipes.ALL, orderby=~db.recipes.submitted)
form=SQLFORM(db.recipes,fields=['category'])
return dict(form=form,recipes=rows)
It displays (with the view file of course) a list of all recipes and a form
where you can choose a category if you choose one it desplays only the ones
from that category.
I tried to modify it a little I like to add the functionallity to display
all recipes from a category but get there with a link.
I thought this would be pretty easy just
use this line:
{{=A("recipes",_href=URL(r=request,f='recipes',vars=dict(id=category.id)))}}
but of course this doesn't work I tried a second try except block with
id=request.vars.id
but that messes all up.
Thanks for your help guys