On 2011-08-30 14:05, Paolo wrote:
> So my question is: is there a way, a function, a point in the web.py
> code where I can put my function that checks for the presence of the
> User-Agent at each request indipendently from the URI requested..?

In my web application I have a decorator around all GETs and
POSTs. In this decorator I check e.g. for HTTP_ACCEPT_LANGUAGE
and do permission checks. Maybe this is a good place to check
the user agent as well.

If you happen to have a login page, you could also only check
there and than store the CSS file name in the session.

> (And my second question would be: am I doing anything really dumb..?
> In other words: is there a much simpler way to do so..?;)

Sounds fine, at least I'm planning to do the same dumb thing.

I wonder, what is the right check for a mobile browser? The most
important thing is screen size, right?

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to