> 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.

Reply via email to