X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/54d1617957cfa3a8c9ffd714ad6c4bef09e727de..0959d38b27c03863ec376839dcc6d896d04e36ea:/philo/templatetags/containers.py diff --git a/philo/templatetags/containers.py b/philo/templatetags/containers.py index f6def0a..e280e60 100644 --- a/philo/templatetags/containers.py +++ b/philo/templatetags/containers.py @@ -1,3 +1,8 @@ +""" +The container 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.contenttypes.models import ContentType @@ -59,9 +64,15 @@ class ContainerNode(template.Node): return content -def do_container(parser, token): +@register.tag +def container(parser, token): """ - {% container [[references ] as ] %} + If a template using this tag is used to render a :class:`.Page`, that :class:`.Page` will have associated content which can be set in the admin interface. If a content type is referenced, then a :class:`.ContentReference` object will be created; otherwise, a :class:`.Contentlet` object will be created. + + Usage:: + + {% container [[references .] as ] %} + """ params = token.split_contents() if len(params) >= 2: @@ -94,6 +105,3 @@ def do_container(parser, token): else: # error raise template.TemplateSyntaxError('"%s" template tag provided without arguments (at least one required)' % tag) - - -register.tag('container', do_container)