parameters: (value, default_value=u'', boolean=False)
return_statement: return value
docstring: If the value is undefined it will return the passed default value,
      otherwise the value of the variable:
  
      .. sourcecode:: jinja
  
          {{ my_variable|default('my_variable is not defined') }}
  
      This will output the value of ``my_variable`` if the variable was
      defined, otherwise ``'my_variable is not defined'``. If you want
      to use default with variables that evaluate to false you have to
      set the second parameter to `true`:
  
      .. sourcecode:: jinja
  
          {{ ''|default('the string was empty', true) }}
docstring_summary: If the value is undefined it will return the passed default value,
      otherwise the value of the variable:
docstring_tokens: If the value is undefined it will return the passed default value otherwise the value of the variable :
function: def do_default(value, default_value=u'', boolean=False):
      """If the value is undefined it will return the passed default value,
      otherwise the value of the variable:
  
      .. sourcecode:: jinja
  
          {{ my_variable|default('my_variable is not defined') }}
  
      This will output the value of ``my_variable`` if the variable was
      defined, otherwise ``'my_variable is not defined'``. If you want
      to use default with variables that evaluate to false you have to
      set the second parameter to `true`:
  
      .. sourcecode:: jinja
  
          {{ ''|default('the string was empty', true) }}
      """
      if isinstance(value, Undefined) or (boolean and not value):
          return default_value
      return value
function_tokens: def do_default ( value , default_value = u'' , boolean = False ) : if isinstance ( value , Undefined ) or ( boolean and not value ) : return default_value return value