> response._vars: this variable is accessible only in a view, not in the
> action. It contains the value returned by the action to the view.


I made a simple test here:

<*controller*>
def myfunc():
    _counter = 0 #I also tried with __counter
    for i in range(101):
        _counter += 1
    return locals()
</*controller*>

This was returned to the view.
>>> print response._vars
{'*i*': 100, '*_counter*': 101}

Is there a way for response._vars ignore the _ and __ variables?

I like this idea, returning locals() is much more cleaner, less annoying and
DRY than renaming vars in a dict, but if I have a lot of  'private' control
vars this will pollute response._vars.

I saw that that BEAUTIFY() ignores that private vars, but in a matter of
memory usage? I don't know how to test this.



Bruno Rocha
http://about.me/rochacbruno/bio

Reply via email to