1 2 3 4 5 6 7 8 9 | def wrapper_function(*args, **kwargs):
arg_names = original_function.func_code.co_varnames
params = dict(zip(arg_names, args))
params.update(kwargs)
# now you have args and kwargs collected to the dictionary params
# you can read and modify them here and then call the original function
return original_function(**params)
|
More like this
- Other approach of making middleware (by decorators) by diverman 11 months, 1 week ago
- object-oriented generic views by carljm 3 years, 5 months ago
- Owner required decorator by polarbear 3 years, 7 months ago
- Resolve URLs to view name and args/kwargs by fahhem 1 year, 2 months ago
- A templatetag to insert the output of another view (or local URL) by jamesgpearce 2 years, 7 months ago
Comments