当前位置: 首页 > 文档资料 > Jinja2 中文文档 >

Jinja2 Changelog

优质
小牛编辑
131浏览
2023-12-01

Version 2.7

(codename to be selected, release date to be announced)

  • Choice and prefix loaders now dispatch source and template lookup separately in order to work in combination with module loaders as advertised.
  • Fixed filesizeformat.
  • Added a non-silent option for babel extraction.
  • Added urlencode filter that automatically quotes values for URL safe usage with utf-8 as only supported encoding. If applications want to change this encoding they can override the filter.
  • Accessing last on the loop context no longer causes the iterator to be consumed into a list.

Version 2.6

(codename Convolution, released on July 24th 2011)

  • internal attributes now raise an internal attribute error now instead of returning an undefined. This fixes problems when passing undefined objects to Python semantics expecting APIs.
  • traceback support now works properly for PyPy. (Tested with 1.4)
  • implemented operator intercepting for sandboxed environments. This allows application developers to disable builtin operators for better security. (For instance limit the mathematical operators to actual integers instead of longs)
  • groupby filter now supports dotted notation for grouping by attributes of attributes.
  • scoped blocks now properly treat toplevel assignments and imports. Previously an import suddenly &"https://www.xnip.cn/doc/jinja-extensions" >新样式 Gettext)
  • it&"https://www.xnip.cn/doc/jinja-api" title="jinja2.ModuleLoader">ModuleLoader that can load templates from precompiled sources. The environment now features a method to compile the templates from a configured loader into a zip file or folder.
  • the _speedups C extension now supports Python 3.
  • added support for autoescaping toggling sections and support for evaluation contexts (求值上下文).
  • extensions have a priority now.

Version 2.3.1

(bugfix release, released on February 19th 2010)

  • fixed an error reporting bug on all python versions
  • fixed an error reporting bug on Python 2.4

Version 2.3

(3000 Pythons, released on February 10th 2010)

  • fixes issue with code generator that causes unbound variables to be generated if set was used in if-blocks and other small identifier problems.
  • include tags are now able to select between multiple templates and take the first that exists, if a list of templates is given.
  • fixed a problem with having call blocks in outer scopes that have an argument that is also used as local variable in an inner frame ("https://www.xnip.cn/doc/jinja-api" >字节码缓存)
  • the template context is now weakref-able
  • inclusions and imports &"https://www.xnip.cn/doc/jinja-extensions" title="jinja2.nodes.Getitem">Getitem and Getattr.

    For more information see the implementation details.

  • added support for preprocessing and token stream filtering for extensions. This would allow extensions to allow simplified gettext calls in template data and something similar.

  • added jinja2.environment.TemplateStream.dump().

  • added missing support for implicit string literal concatenation. {{ "foo" "bar" }} is equivalent to {{ "foobar" }}

  • else is optional for conditional expressions. If not given it evaluates to false.

  • improved error reporting for undefined values by providing a position.

  • filesizeformat filter uses decimal prefixes now per default and can be set to binary mode with the second parameter.

  • fixed bug in finalizer

Version 2.0rc1

(no codename, released on June 9th 2008)

  • first release of Jinja2