With the accept predicate keyword to view_config I can match views based on 
the Accept header. But if I have multiple views for the same route, I want 
to have a "default" view if none of other specified accept rules match. 
This doesn't seem to work when the Accept header is "*/*". For instance, in 
a configuration like http://paste.ofcode.org/GS6U9X2G3f8XneKJAQ7F3C the 
result seems to be completely nondeterministic, but somehow stable after 
app configuration and scan() happened. Also, specifying a view without any 
accept predicate doesn't seem to do the trick (
http://paste.ofcode.org/38T5T7VnB7f3etx5XiKE3V6). 

Is there a way to get a fixed default behavior without inspecting the 
request object at runtime? I found this thread: 
https://groups.google.com/d/msg/pylons-discuss/XkDlQTj9m44/MNlqgMvCCfsJ but 
this doesn't seem to solve the problem either:

The Pyramid URL dispatch mechanism is basically "An ordered set of 
> patterns is checked one-by-one" so, if you simply remove the 
> specialising match parameter, you're left with a catch-all which, to be 
> effective, needs to appear last in the batting order: 
>

But this doesn't seem work (see second paste).

Thanks,
Stefan

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to