Simon Willison’s Weblog

5 items tagged “decorators”

django-boss (via) Management commands are one of the few bits of Django that I still have to look up in the documentation whenever I write them. django-boss offers a smart alternative to regular management commands, based around decorators and taking the containing app as the first argument. # 1st June 2010, 10:02 am

Decorator to limit request rates to individual views. Neat piece of code for public facing web APIs written in Django. Update: some smart criticisms in the comments. # 24th September 2008, 1:13 pm

AOP aspect of JavaScript with Dojo. Fantastic post—concisely explains Aspect Oriented Programming, then shows how Dojo’s dojox.lang.aspect brings AOP to JavaScript, including some really useful built-in aspects for logging, profiling and more. Aspects are like Python decorators on steroids. # 18th May 2008, 10:45 am

Monkeypatching idioms—elegant or ugly? Guido offers a decorator and a metaclass as syntactic sugar for monkeypatching existing Python classes. # 30th January 2008, 12:39 am

Meta-classes Made Easy. Fuzzyman introduces a metaclass factory for applying a decorator to every method of a class. # 17th December 2006, 12:42 am