Hi,

sorry for my poor english...

I'm wondering how can I put controller code filters like rails
(before_filter / after_filter / around_filter).

Searching into user group posts I see many responses on activerecord
callbacks (before_save / after_save) wrongly referred to question on
before/after/around filter (controller filter).

Now I know that in web2py I can put code into model /db.py) and that
code is execute before globals and before controller code, my
questions are:

1. in rails I write before_filter only for given controllers and given
actions, seems that in web2py if I write the code in db.py it is
executed for all controllers and actions, is there a way to limit that
code execution to given controllers and actions ? (I think that put
too much code into db.py may slow the excution of requests, it'isnt ?)

2. how can I write code execution that emulates after_filter or
around_filter ala Rails ? (example: I want to track remote ip for all
my controller/actions into database...),

Many thanks in advance.

Tex

Reply via email to