A action decorator for URLs

1
2
3
4
5
6
def action(views):
    def _dec(request, *args, **kwargs):
        action = kwargs['action']
        del kwargs['action']
        return getattr(views, action)(request, *args, **kwargs)
    return _dec

More like this

  1. Using class methods as views by panyam 2 years, 11 months ago
  2. load m2m fields objects by dirol 1 year, 11 months ago
  3. REMOVE IMAGEFIELD ATTACHMENT IN DJANGO by timonweb 2 weeks, 4 days ago
  4. Add multiple parameters to the current url by cschand 3 years, 10 months ago
  5. Owner required decorator by polarbear 3 years, 10 months ago

Comments

(Forgotten your password?)