vendredi 30 octobre 2015

Problems with Pyramid Traversal and Browsers Back-Button

I'm using Pyramids Traversal and got some problems. Let us say, I've this config:

config.add_route('main_dis','/dis/{params}/go')
config.add_route('ajax_R1', '/dis/{url:.*}ajax_R1')
config.add_route('ajax_R2', '/dis/{url:.*}ajax_R2')

whereby the first one is a view config for chameleon, and the second and third one for json. If I call http://ift.tt/1LG48wz, an ajax request will get information by calling ajax_R1. Afterwards the user can click something and go to http://ift.tt/1Mxmq6X, which calls ajax_R2. If the user want to navigate back from B towards A, the ajax request is fired, but pyramids does not finds the suitable view, so that the notfound_view_config is called. Does someone has an idea for this behaviour?

One "dirty fix" is to check the path-variable in the request of the notfound_view_config and calling the suitable method, but this is very dirty :(

Thanks, Tobias

P.S.: Hopefully my problem will not be taken the wrong way :)




Aucun commentaire:

Enregistrer un commentaire