I already do something like this.

if 'iPad' in request.env.http_user_agent:
    response.view = 'default/mobile.html'
elif ...
elif...
else...

2011/1/4 VP <[email protected]>

> In controller/default.py:
>
> def show_item():
>   ....
>   return dict( items = items)
>
>
> In the view/default/ directory, we have different views.  For example:
>
> view/default/show_item.html    <==== default
> view/default/show_item.ipad.html  <==== to be called if the user agent
> is an iPad
> view/default/show_item.mobile.html  <==== to be called if the user
> agent is a mobile phone.
>
>
> I think this feature can be easily implemented and it will make lives
> a little easier for people who target different platforms.
>
> Thanks.




-- 

Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to