36,65c36
<     
<     Here is an example hos to automatically translate your django
<     variables to jinja2::
<         
<         import re
<         # List of tuple (Match pattern, Replace pattern, Exclusion pattern)
<         
<         var_re  = ((re.compile(r"(u|user)\.is_authenticated"), r"\1.is_authenticated()", None),
<                   (re.compile(r"\.non_field_errors"), r".non_field_errors()", None),
<                   (re.compile(r"\.label_tag"), r".label_tag()", None),
<                   (re.compile(r"\.as_dl"), r".as_dl()", None),
<                   (re.compile(r"\.as_table"), r".as_table()", None),
<                   (re.compile(r"\.as_widget"), r".as_widget()", None),
<                   (re.compile(r"\.as_hidden"), r".as_hidden()", None),
<                   
<                   (re.compile(r"\.get_([0-9_\w]+)_url"), r".get_\1_url()", None),
<                   (re.compile(r"\.url"), r".url()", re.compile(r"(form|calendar).url")),
<                   (re.compile(r"\.get_([0-9_\w]+)_display"), r".get_\1_display()", None),
<                   (re.compile(r"loop\.counter"), r"loop.index", None),
<                   (re.compile(r"loop\.revcounter"), r"loop.revindex", None),
<                   (re.compile(r"request\.GET\.([0-9_\w]+)"), r"request.GET.get('\1', '')", None),
<                   (re.compile(r"request\.get_host"), r"request.get_host()", None),
<                   
<                   (re.compile(r"\.all(?!_)"), r".all()", None),
<                   (re.compile(r"\.all\.0"), r".all()[0]", None),
<                   (re.compile(r"\.([0-9])($|\s+)"), r"[\1]\2", None),
<                   (re.compile(r"\.items"), r".items()", None),
<         )
<         writer = Writer(var_re=var_re)
<         
---
> 
159,160c130
<                  custom_node_handlers=None,
<                  var_re=[]):
---
>                  custom_node_handlers=None):
177a148
> 
180d150
<         self.var_re = var_re
311,317c281
<             var = var[3:]
<         
<         for reg, rep, unless in self.var_re:
<             no_unless = unless and unless.search(var) or True
<             if reg.search(var) and no_unless:
<                 var = reg.sub(rep, var)
<                 break
---
>             return var[3:]
333c297
<             if type(node) is cls or type(node).__name__ == cls:
---
>             if type(node) is cls:
420,423c384
<     join_with = 'and'
<     if node.link_type == core_tags.IfNode.LinkTypes.or_:
<         join_with = 'or'
<     
---
>     join_with = core_tags.IfNode.LinkTypes.or_ and 'or' or 'and'
443,446c404
<     if node.negate:
<         writer.write(' != ')
<     else:
<         writer.write(' == ')
---
>     writer.write(' == ')
722,763d679
< @node("SimpleNode")
< def simple_tag(writer, node):
<     """Check if the simple tag exist as a filter in """
<     #TODO, how to get jinja2 Envirionment?
<     from django_jinja2 import get_env
<     _env = get_env()
<     
<     name = node.tag_name
<     if name not in _env.filters and \
<        name not in writer._filters_warned:
<         writer._filters_warned.add(name)
<         writer.warn('Filter %s probably doesn\'t exist in Jinja' %
<                     name)
<         
<     if not node.vars_to_resolve:
<         # No argument, pass the request
<         writer.start_variable()
<         writer.write('request|')
<         writer.write(name)
<         writer.end_variable()
<         return 
<     
<     first_var =  node.vars_to_resolve[0]
<     args = node.vars_to_resolve[1:]
<     writer.start_variable()
<     
<     # Copied from Writer.filters()
<     writer.node(first_var)
<     
<     writer.write('|')
<     writer.write(name)
<     if args:
<         writer.write('(')
<         for idx, var in enumerate(args):
<             if idx:
<                 writer.write(', ')
<             if var.var:
<                 writer.node(var)
<             else:
<                 writer.literal(var.literal)
<         writer.write(')')
<     writer.end_variable()   
