Decorator

 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

  1. group_required decorator by msanders 4 years, 7 months ago
  2. Decorator to execute a method only once by atodorov-otb 4 months ago
  3. MultiFormWizard by flashingpumpkin 4 years, 11 months ago
  4. SelectDateWidget by silent1mezzo 3 years, 4 months ago
  5. Extended Form Wizard with ability to go backwards by mtsyganov 4 years, 12 months ago

Comments

(Forgotten your password?)