On Jan 6, 8:47 am, Chris McDonough <chr...@plope.com> wrote: > On Thu, 2012-01-05 at 23:49 -0800, Martin Aspeli wrote: > > > On Jan 6, 7:06 am, Chris McDonough <chr...@plope.com> wrote: > > > Thanks, I'm tracking this athttps://github.com/Pylons/pyramid/issues/394 > > > Great! > > > Side question - is my approach a reasonable one for mobile sniffing? > > It's probably more direct to use a custom view predicate rather than > indirectly choosing a view based on the interfaces of the request. See > the custom_predicates argument to view_config.
Yeah, I started there, but I ended up wanting to cache the "is mobile" status on the request anyway (for explicit checks elsewhere) so I ended up with a NewRequest event handler setting a request attribute and a custom_predicates function checking this, which just seemed like more work than tagging the request with a request type. Martin -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.