Index: django/template/defaulttags.py
===================================================================
--- django/template/defaulttags.py	(revision 4812)
+++ django/template/defaulttags.py	(working copy)
@@ -6,6 +6,10 @@
 from django.conf import settings
 import sys
 
+# For Python 2.3
+if not hasattr(__builtins__, 'set'):
+    from sets import Set as set
+
 register = Library()
 
 class CommentNode(Node):
@@ -176,10 +180,10 @@
         return self.nodelist_false.render(context)
 
 class IfNode(Node):
-    def __init__(self, bool_exprs, nodelist_true, nodelist_false, link_type):
-        self.bool_exprs = bool_exprs
+    def __init__(self, expression, variables, nodelist_true, nodelist_false):
+        self.expression = expression
+        self.variables = variables
         self.nodelist_true, self.nodelist_false = nodelist_true, nodelist_false
-        self.link_type = link_type
 
     def __repr__(self):
         return "<If node>"
@@ -199,29 +203,25 @@
         return nodes
 
     def render(self, context):
-        if self.link_type == IfNode.LinkTypes.or_:
-            for ifnot, bool_expr in self.bool_exprs:
-                try:
-                    value = bool_expr.resolve(context, True)
-                except VariableDoesNotExist:
-                    value = None
-                if (value and not ifnot) or (ifnot and not value):
-                    return self.nodelist_true.render(context)
+        variable_context = {}
+        expression = self.expression
+        for variable in self.variables:
+            try:
+                value = variable.resolve(context, True)
+            except VariableDoesNotExist:
+                value = None
+
+            context_name = 'var%s' % len(variable_context)
+            expression = re.sub(r'(?<![\w\.\"\'])%s(?![\w\.\"\'])' % re.escape(variable.token), context_name, expression)
+            variable_context[context_name] = value
+        try:
+            resultant = eval(expression, variable_context)
+        except:
+            resultant = False
+        if not resultant:
             return self.nodelist_false.render(context)
-        else:
-            for ifnot, bool_expr in self.bool_exprs:
-                try:
-                    value = bool_expr.resolve(context, True)
-                except VariableDoesNotExist:
-                    value = None
-                if not ((value and not ifnot) or (ifnot and not value)):
-                    return self.nodelist_false.render(context)
-            return self.nodelist_true.render(context)
+        return self.nodelist_true.render(context)
 
-    class LinkTypes:
-        and_ = 0,
-        or_ = 1
-
 class RegroupNode(Node):
     def __init__(self, target, expression, var_name):
         self.target, self.expression = target, expression
@@ -622,42 +622,21 @@
             There are no athletes, or there are some coaches.
         {% endif %}
 
-    For simplicity, ``if`` tags do not allow ``and`` clauses. Use nested ``if``
-    tags instead::
+    Regular python conditional syntax and comparisons are avaialble, however,
+    variables must use the Django Template "." syntax to access dict keys and 
+    array indicies. 
 
-        {% if athlete_list %}
-            {% if coach_list %}
-                Number of athletes: {{ athlete_list|count }}.
-                Number of coaches: {{ coach_list|count }}.
-            {% endif %}
-        {% endif %}
+	{% if ("Jacob" in athelete_list and "Mike" not in athelete_list) or athelete_list.count > 2  %}
+             Jacob is an athelete and Mikey is not OR there are more than 2 atheletes.
+	{% endif %} 
     """
-    bits = token.contents.split()
+    bits = token.contents.split(None, 1)
     del bits[0]
-    if not bits:
+    expression = bits[0]
+    variables = set([ parser.compile_filter(x) for x in re.findall('[\w\.]+', expression) if x not in ('and', 'or', 'not', 'in') ])
+    if not variables:
         raise TemplateSyntaxError, "'if' statement requires at least one argument"
-    # bits now looks something like this: ['a', 'or', 'not', 'b', 'or', 'c.d']
-    bitstr = ' '.join(bits)
-    boolpairs = bitstr.split(' and ')
-    boolvars = []
-    if len(boolpairs) == 1:
-        link_type = IfNode.LinkTypes.or_
-        boolpairs = bitstr.split(' or ')
-    else:
-        link_type = IfNode.LinkTypes.and_
-        if ' or ' in bitstr:
-            raise TemplateSyntaxError, "'if' tags can't mix 'and' and 'or'"
-    for boolpair in boolpairs:
-        if ' ' in boolpair:
-            try:
-                not_, boolvar = boolpair.split()
-            except ValueError:
-                raise TemplateSyntaxError, "'if' statement improperly formatted"
-            if not_ != 'not':
-                raise TemplateSyntaxError, "Expected 'not' in if statement"
-            boolvars.append((True, parser.compile_filter(boolvar)))
-        else:
-            boolvars.append((False, parser.compile_filter(boolpair)))
+
     nodelist_true = parser.parse(('else', 'endif'))
     token = parser.next_token()
     if token.contents == 'else':
@@ -665,7 +644,7 @@
         parser.delete_first_token()
     else:
         nodelist_false = NodeList()
-    return IfNode(boolvars, nodelist_true, nodelist_false, link_type)
+    return IfNode(expression, variables, nodelist_true, nodelist_false)
 do_if = register.tag("if", do_if)
 
 #@register.tag
