  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  If you're writing a template filter that only expects a string as the first
  argument, you should use the decorator ``stringfilter``. This will
  convert an object to its string value before being passed to your function::
  
      from django import template
      from django.template.defaultfilters import stringfilter
  
      register = template.Library()
 
</s> remove Now your tag should begin to look like this::
 </s> add Now your tag should begin to look like this:

.. code-block:: python </s> remove returned the string, suppose you wanted to pass in a ``DateTimeField`` from an
object and have the template tag format that date-time:
 </s> add returned the string, suppose you wanted to pass in a
:class:`~django.db.models.DateTimeField` from an object and have the template
tag format that date-time: </s> remove following::
 </s> add following:

.. code-block:: python </s> remove        For example, suppose you have a filter that adds the string ``xx`` to the
       end of any input. Since this introduces no dangerous HTML characters to
       the result (aside from any that were already present), you should mark
       your filter with ``is_safe``::
 </s> add        For example, suppose you have a filter that adds the string ``xx`` to
       the end of any input. Since this introduces no dangerous HTML characters
       to the result (aside from any that were already present), you should
       mark your filter with ``is_safe``:

       .. code-block:: python </s> remove Continuing the above example, we need to define ``CurrentTimeNode``::
 </s> add Continuing the above example, we need to define ``CurrentTimeNode``:

.. code-block:: python
convert an object to its string value before being passed to your function:

.. code-block:: python
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
  If you're writing a template filter that only expects a string as the first
  argument, you should use the decorator ``stringfilter``. This will
convert an object to its string value before being passed to your function:

.. code-block:: python
  
      from django import template
      from django.template.defaultfilters import stringfilter
  
      register = template.Library()
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