- Author:
- chachan
- Posted:
- April 19, 2013
- Language:
- Python
- Version:
- Not specified
- Score:
- 0 (after 0 ratings)
[Understanding Python Decorators in 12 Easy Steps!] (http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/)
1 2 3 4 5 6 7 8 9 10 | def decorator(func):
def inner(*args, **kwargs):
# Code in here
return func(*args, **kwargs)
return inner
# Use
@decorator
def view_function(request):
pass
|
More like this
- Browser-native date input field by kytta 4 weeks, 1 day ago
- Generate and render HTML Table by LLyaudet 1 month, 1 week ago
- My firs Snippets by GutemaG 1 month, 1 week ago
- FileField having auto upload_to path by junaidmgithub 2 months, 2 weeks ago
- LazyPrimaryKeyRelatedField by LLyaudet 2 months, 3 weeks ago
Comments
Please login first before commenting.