X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/ac6ebd8b38a46afb0b249574be71a276f95b6efa..6164c1b917297594aad253cd404240bfde9cef81:/philo/templatetags/nodes.py diff --git a/philo/templatetags/nodes.py b/philo/templatetags/nodes.py index a926f98..189fdd5 100644 --- a/philo/templatetags/nodes.py +++ b/philo/templatetags/nodes.py @@ -1,3 +1,8 @@ +""" +The node template tags are automatically included as builtins if :mod:`philo` is an installed app. + +""" + from django import template from django.conf import settings from django.contrib.sites.models import Site @@ -65,9 +70,11 @@ class NodeURLNode(template.Node): return url -@register.tag(name='node_url') -def do_node_url(parser, token): +@register.tag +def node_url(parser, token): """ + The :ttag:`node_url` tag allows access to :meth:`.View.reverse` from a template for a :class:`.Node`. By default, the :class:`.Node` that is used for the call is pulled from the context variable ``node``; however, this can be overridden with the ``[for ]`` option. + Usage:: {% node_url [for ] [as ] %}