I did it the mdpierro way because just saw your post. Your way would have worked too. Exactly what I wanted.
Thanks On May 19, 10:36 am, annet <[email protected]> wrote: > > I want the user to click on the link and if there is already > > a project _location for a project then just display it (crud.read), > > if the project has no location associated, then it will give me > > crud.write. I know it must be simple but I cant figure it out. > > I am not sure I do understand your problem correctly, but I'll give it > a try. You list projects, when the user clicks on one of the projects, > depending on the project's location being set or not you either > display the project's details or display an update form > > @auth.requires_login() > def update_project_location(): > projects=db(..).select(..) > form=[] > if request.args: > project_id=request.args(0) > project=db.project[project_id] > if project[0].location: > form=crud.read(db.project,project_id) > else: > form=crud.update(db.project,project_id) > return(projects=projects,form=form) > > I hope this helps to point you in right direction. > > Annet.

