X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/1324f9b1e4d57c5ab50bc264507f7adc3207eb99..0959d38b27c03863ec376839dcc6d896d04e36ea:/philo/templatetags/nodes.py diff --git a/philo/templatetags/nodes.py b/philo/templatetags/nodes.py index 1d095bc..189fdd5 100644 --- a/philo/templatetags/nodes.py +++ b/philo/templatetags/nodes.py @@ -1,20 +1,6 @@ """ The node template tags are automatically included as builtins if :mod:`philo` is an installed app. -.. templatetag:: node_url - -node_url --------- - -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 ] %} - {% node_url with [for ] [as ] %} - {% node_url [ [ ...] ] [for ] [as ] %} - {% node_url [= [= ...] ] [for ] [as ] %} - """ from django import template @@ -84,13 +70,17 @@ class NodeURLNode(template.Node): return url -@register.tag(name='node_url') -def do_node_url(parser, token): +@register.tag +def node_url(parser, token): """ - {% node_url [for ] [as ] %} - {% node_url with [for ] [as ] %} - {% node_url [ [ ...] ] [for ] [as ] %} - {% node_url [= [= ...] ] [for ] [as ] %} + 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 ] %} + {% node_url with [for ] [as ] %} + {% node_url [ [ ...] ] [for ] [as ] %} + {% node_url [= [= ...] ] [for ] [as ] %} """ params = token.split_contents()