From 15da421f70d9170b04f0c8facd9c85b023f16eb7 Mon Sep 17 00:00:00 2001 From: Joseph Spiros Date: Thu, 10 Jun 2010 04:14:00 -0400 Subject: [PATCH] Fixing style issues and an incorrect modification of .gitignore. --- .gitignore | 3 --- models.py | 3 +-- templatetags/containers.py | 5 ++++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5cde84d..0d20b64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ *.pyc -*~ -*# -TODO diff --git a/models.py b/models.py index dcb5d74..eb6ebc0 100644 --- a/models.py +++ b/models.py @@ -286,8 +286,7 @@ class File(Node): 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 diff --git a/templatetags/containers.py b/templatetags/containers.py index 25156f2..ca5e1e9 100644 --- a/templatetags/containers.py +++ b/templatetags/containers.py @@ -25,7 +25,7 @@ class ContainerNode(template.Node): 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: @@ -78,6 +78,7 @@ class ContainerNode(template.Node): content = '' return content + def do_container(parser, token): """ {% container [[references ] as ] %} @@ -125,5 +126,7 @@ 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) register.tag('blockcontainer', do_container) -- 2.20.1