You could use a URL arg to identify specific items and trigger a 
single-item display when present:

def myitems():
    item = get_my_item(request.args(0)) if request.args else None
    item_list = generate_list() if not request.args else None
    return dict(item=item, item_list=item_list)

{{if item:}}
[code to display the item]
{{elif item_list:}}
{{for item in item_list:}}
<a href="{{=URL('default', 'myitems', args=item.id)}}">{{=item.name}}</a><br 
/>
{{pass}}

If there is no request.args(0), the controller returns the full list and 
the view displays the list with individual links to each item. When a link 
is clicked, the item ID is included as request.args(0) in the URL, and in 
that case, the function returns the individual item and the view displays 
the item.

Anthony

On Saturday, August 31, 2013 11:40:25 PM UTC-7, אבי אברמוביץ wrote:
>
> Hi,
> I understand the url structure: app/function/view
> but assuming I have a list of items on the view, How do I get to a view 
> page for each one of them and where can I build that page template? 
> Thanks.
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to