Model files are executed on every request before the controller action is called, so you could simply put your code in a model file (note, most of the code could actually go in a module, which you could then simply import in a model). Models are executed in alphabetical order, so if you want your code to run before any other model code, just name the model file something like 0_intercept.py.
Anthony On Tuesday, August 6, 2013 8:24:39 PM UTC-4, Marcio Andrey Oliveira wrote: > > So I don't know what to do. I was reading about the conditional models but > it doesn't seem to be what I want. > > I will try to explain (forgive my bad English): > > From my own application I want to be able to intercept requests to some / > all URLs (it varies based on what I want to do) so that I could decide if I > would log the incoming data, redirect or drop it it based in some criteria > (is mobile, is from some country, and so on) or even change the request > parameters prior it arrives to the target URL. > > But I want to do these things without to incorporate this code into my > controllers. > > On Java this is done using servlet filters. > > Any suggestion? A sampke or doc showing this kind of situation? > > Thanks. > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

