]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
Merge branch '2.10.x'
authorDavid Lord <davidism@gmail.com>
Sat, 20 Jul 2019 21:03:04 +0000 (14:03 -0700)
committerDavid Lord <davidism@gmail.com>
Sat, 20 Jul 2019 21:03:04 +0000 (14:03 -0700)
1  2 
CHANGES.rst
docs/api.rst
docs/faq.rst
docs/templates.rst

diff --cc CHANGES.rst
index 0042a501040675e4e08f41aee76a1a68998685be,78e1329410e8c2f6b6f3200477c5aa83b3e4caf9..b3b667d60a9ff0d91c4ed5ea116c440e3df6cb21
@@@ -4,23 -2,13 +4,30 @@@ Jinja Changelo
  ===============
  
  
 +Version 2.11
 +------------
 +
 +unreleased
 +
 +- Async support is only loaded the first time an
 +  :class:`~environment.Environment` enables it, in order to avoid a
 +  slow initial import. (`#765`_)
 +- Python 2.6 and 3.3 are not supported anymore.
 +- The ``map`` filter in async mode now automatically awaits
 +- Added a new ``ChainableUndefined`` class to support getitem
 +  and getattr on an undefined object. (`#977`_)
 +
 +.. _#765: https://github.com/pallets/jinja/issues/765
 +.. _#977: https://github.com/pallets/jinja/issues/977
 +
 +
+ Version 2.10.2
+ --------------
+ _Unreleased_
+ -  Fix Python 3.7 deprecation warnings.
  Version 2.10.1
  --------------
  
diff --cc docs/api.rst
Simple merge
diff --cc docs/faq.rst
Simple merge
index bc18d99814a1df829a83785c8e668680a9611e45,345344e053a05e57ebc71feafab15c91cfaa5482..cb20ba2c40e3261eeeb96f0d6c93ef93ca1dbbd7
@@@ -1351,11 -1312,33 +1352,33 @@@ something else>``
  The `else` part is optional.  If not provided, the else block implicitly
  evaluates into an undefined object:
  
 -.. sourcecode:: jinja
 +.. code-block:: text
  
 -    {{ '[%s]' % page.title if page.title }}
 +    {{ ('[%s]' % page.title) if page.title }}
  
  
+ .. _python-methods:
+ Python Methods
+ ~~~~~~~~~~~~~~
+ You can also use any of the methods of defined on a variable's type.
+ The value returned from the method invocation is used as the value of the expression.
+ Here is an example that uses methods defined on strings (where ``page.title`` is a string):
+ .. code-block:: text
+     {{ page.title.capitalize() }}
+ This also works for methods on user-defined types.
+ For example, if variable ``f`` of type ``Foo`` has a method ``bar`` defined on it,
+ you can do the following:
+ .. code-block:: text
+     {{ f.bar() }}
  .. _builtin-filters:
  
  List of Builtin Filters