- 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
- Form field with fixed value by roam 3 days, 18 hours ago
- New Snippet! by Antoliny0919 1 week, 3 days ago
- Add Toggle Switch Widget to Django Forms by OgliariNatan 2 months, 4 weeks ago
- get_object_or_none by azwdevops 6 months, 3 weeks ago
- Mask sensitive data from logger by agusmakmun 8 months, 2 weeks ago
Comments
Please login first before commenting.