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 4 years, 10 months ago
  2. load m2m fields objects by dirol 3 years, 10 months ago
  3. ParentModel and ChildManager for Model Inheritance by jpwatts 5 years, 7 months ago
  4. PK->objects in view signature by AdamKG 6 years ago
  5. Resolve URLs to view name and args/kwargs by fahhem 3 years, 5 months ago

Comments

(Forgotten your password?)