  with the ``context`` of the template that is currently being rendered. The
  ``render_context`` behaves like a Python dictionary, and should be used to store
  ``Node`` state between invocations of the ``render`` method.
  
  Let's refactor our ``CycleNode`` implementation to use the ``render_context``::
  
      class CycleNode(Node):
          def __init__(self, cyclevars):
              self.cyclevars = cyclevars
          def render(self, context):
 
</s> remove ``render_context`` behaves like a Python dictionary, and should be used to store
``Node`` state between invocations of the ``render`` method.
 </s> add ``render_context`` behaves like a Python dictionary, and should be used to
store ``Node`` state between invocations of the ``render`` method. </s> remove A naive implementation of ``CycleNode`` might look something like this::
 </s> add A naive implementation of ``CycleNode`` might look something like this:

.. code-block:: python </s> remove outputting it::
 </s> add outputting it:

.. 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 </s> remove     given template, so we need to be careful not to clobber another node's state
    information. The easiest way to do this is to always use ``self`` as the key
    into ``render_context``. If you're keeping track of several state variables,
    make ``render_context[self]`` a dictionary.
 </s> add     given template, so we need to be careful not to clobber another node's
    state information. The easiest way to do this is to always use ``self`` as
    the key into ``render_context``. If you're keeping track of several state
    variables, make ``render_context[self]`` a dictionary.
Let's refactor our ``CycleNode`` implementation to use the ``render_context``:

.. code-block:: python
  with the ``context`` of the template that is currently being rendered. The
  ``render_context`` behaves like a Python dictionary, and should be used to store
  ``Node`` state between invocations of the ``render`` method.
  
Let's refactor our ``CycleNode`` implementation to use the ``render_context``:

.. code-block:: python
  
      class CycleNode(Node):
          def __init__(self, cyclevars):
              self.cyclevars = cyclevars
          def render(self, context):
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