class Template(TreeModel):
name = models.CharField(max_length=255)
documentation = models.TextField(null=True, blank=True)
- mimetype = models.CharField(max_length=255, null=True, blank=True,
- help_text='Default: %s' % settings.DEFAULT_CONTENT_TYPE)
+ mimetype = models.CharField(max_length=255, null=True, blank=True, help_text='Default: %s' % settings.DEFAULT_CONTENT_TYPE)
code = models.TextField(verbose_name='django template code')
@property
self.nodelist_empty = template.NodeList()
else:
self.nodelist_empty = nodelist_empty
-
+
def render(self, context):
content = settings.TEMPLATE_STRING_IF_INVALID
if 'page' in context:
content = ''
return content
+
def do_container(parser, token):
"""
{% container <name> [[references <type>] as <variable>] %}
else: # error
raise template.TemplateSyntaxError('"%s" template tag provided without arguments (at least one required)' % tag)
+
+
register.tag('container', do_container)
register.tag('blockcontainer', do_container)