      1. The name of the filter -- a string.
      2. The compilation function -- a Python function (not the name of the
         function as a string).
  
  You can use ``register.filter()`` as a decorator instead::
  
      @register.filter(name='cut')
      def cut(value, arg):
          return value.replace(arg, '')
  
 
</s> remove As with filter registration, it is also possible to use this as a decorator::
 </s> add As with filter registration, it is also possible to use this as a decorator:

.. code-block:: python </s> remove Here's an example filter definition::
 </s> add Here's an example filter definition:

.. code-block:: python </s> remove back to the main page. Here's what the Python function would look like::
 </s> add back to the main page. Here's what the Python function would look like:

.. code-block:: python </s> remove         "Removes all values of arg from the given string"
 </s> add         """Removes all values of arg from the given string""" </s> remove for the template fragment. Example::
 </s> add for the template fragment. Example:

.. code-block:: python
You can use ``register.filter()`` as a decorator instead:

.. code-block:: python
      1. The name of the filter -- a string.
      2. The compilation function -- a Python function (not the name of the
         function as a string).
  
You can use ``register.filter()`` as a decorator instead:

.. code-block:: python
  
      @register.filter(name='cut')
      def cut(value, arg):
          return value.replace(arg, '')
  
keep keep keep keep replace keep keep keep keep keep
 Brushed up the custom template tag 'howto' guide by moving the assignment_tag doc to a more appropriate place (i.e. under the "Setting a variable in the context" section), adding cross references, fixing a few minor inaccuracies and doing a little PEP8 cleanup.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16909 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
docs/howto/custom-template-tags.txt