Hi
I'm trying to create wrapper/decorator functions like so:

The view to load is the same html file every time, the args need to be 
different. 
I can pass arguments using request.args[0] etc. but it seems dirty and I 
prefer to separate and handle pre-processing the data (according to args) 
in the wrapping functions & then call the generalFunc.

def func1():
    var1 = ... 
    var2 = ... 
    return genralFunc(var1 , var2 )

def func2():
    var1 = ... 
    var2 = ...
    var3 = ... 
    return genralFunc(var1 , var2 , var3)

def generalFunc(a , b , c):
    ...dostuff...
    return (dict( ...... all page data .....))

user calls controller/func1 => main_page.html
user calls controller/func2 => main_page.html

Each time with different data

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c137f204-c84b-4658-9d67-e622f7564477%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to