Login

Tag "process_view"

Snippet List

BeforeFilter Middleware

Expanded version of [snippet 715](http://www.djangosnippets.org/snippets/715/ "Django snippets: Simple View Middleware to allow a Prefilter") to be more flexible. Updates: * 2009-04-24: Multiple filters now work correctly * 2009-03-22: Fixed bug * 2009-02-03: Simplified process.

  • middleware
  • process_view
  • beforefilter
Read More

Simple View Middleware to allow a Prefilter

This allows you to define a 'prefilter' function in your view modules which will be invoked before any view in that same. This provides an easy place to decorate the request or modify arguments. For simplicity it doesn't allow configuration of the name of the prefilter function. I also skipped recursing into parent modules since that's somewhat edgecase.

  • middleware
  • process_view
  • prefilter
  • beforefilter
Read More

3 snippets posted so far.