App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Classes | Functions | Variables
google.appengine._internal.django.template.smartif Namespace Reference

Classes

class  EndToken
 
class  IfParser
 
class  Literal
 
class  TokenBase
 

Functions

def infix
 
def prefix
 

Variables

dictionary OPERATORS
 
tuple EndToken = EndToken()
 
 first
 
 second
 

Detailed Description

Parser and utilities for the smart 'if' tag

Function Documentation

def google.appengine._internal.django.template.smartif.infix (   bp,
  func 
)
Creates an infix operator, given a binding power and a function that
evaluates the node
def google.appengine._internal.django.template.smartif.prefix (   bp,
  func 
)
Creates a prefix operator, given a binding power and a function that
evaluates the node.

Variable Documentation

dictionary google.appengine._internal.django.template.smartif.OPERATORS
Initial value:
1 = {
2  'or': infix(6, lambda context, x, y: x.eval(context) or y.eval(context)),
3  'and': infix(7, lambda context, x, y: x.eval(context) and y.eval(context)),
4  'not': prefix(8, lambda context, x: not x.eval(context)),
5  'in': infix(9, lambda context, x, y: x.eval(context) in y.eval(context)),
6  'not in': infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)),
7  '=': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
8  '==': infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),
9  '!=': infix(10, lambda context, x, y: x.eval(context) != y.eval(context)),
10  '>': infix(10, lambda context, x, y: x.eval(context) > y.eval(context)),
11  '>=': infix(10, lambda context, x, y: x.eval(context) >= y.eval(context)),
12  '<': infix(10, lambda context, x, y: x.eval(context) < y.eval(context)),
13  '<=': infix(10, lambda context, x, y: x.eval(context) <= y.eval(context)),
14 }