summaryrefslogtreecommitdiff
path: root/django/template/__init__.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-06-07 04:12:39 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-06-07 04:12:39 +0000
commitb78b1b98fff1d7059d7c6b9698857942ac42a4fb (patch)
tree4585441d5a07b63546352c0793011194365cc41c /django/template/__init__.py
parent3db34ce73e97c4996f6e3e3d1ddef261667ae9a9 (diff)
Small improvement to django.template.resolve_variable -- isdigit() instead of 0123456789
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/template/__init__.py')
-rw-r--r--django/template/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/template/__init__.py b/django/template/__init__.py
index b526863fbf..cf65caef07 100644
--- a/django/template/__init__.py
+++ b/django/template/__init__.py
@@ -544,7 +544,7 @@ class FilterExpression(object):
upto = match.end()
if upto != len(token):
raise TemplateSyntaxError, "Could not parse the remainder: %s" % token[upto:]
- self.var , self.filters = var, filters
+ self.var, self.filters = var, filters
def resolve(self, context):
try:
@@ -614,7 +614,7 @@ def resolve_variable(path, context):
(The example assumes VARIABLE_ATTRIBUTE_SEPARATOR is '.')
"""
- if path[0] in '0123456789':
+ if path[0].isdigit():
number_type = '.' in path and float or int
try:
current = number_type(path)
@@ -655,7 +655,7 @@ def resolve_variable(path, context):
if getattr(e, 'silent_variable_failure', False):
current = settings.TEMPLATE_STRING_IF_INVALID
else:
- raise
+ raise
del bits[0]
return current