Skip to content
Myr

Merge branch '2.9-maintenance'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parents 220659b, 7854851 · Browse files · 3 files+20 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+20 added−0 removed

  • tests:+7 added−0 removed
  • other:+13 added−0 removed

3 files+20 added−0 removed

modified:jinja2/filters.py+6 added
686 unmodified lines
687 func = getattr(math, method)688 return func(value * (10 ** precision)) / (10 ** precision)689690691# Use a regular tuple repr here. This is what we did in the past and we692# really want to hide this custom type as much as possible. In particular693# we do not want to accidentally expose an auto generated repr in case694# people start to print this out in comments or something similar for695# debugging.696_GroupTuple = namedtuple('_GroupTuple', ['grouper', 'list'])697_GroupTuple.__repr__ = tuple.__repr__698699@environmentfilter700def do_groupby(environment, value, attribute):701 """Group a sequence of objects by a common attribute.
371 unmodified lines
modified:tests/test_regression.py+7 added
495 unmodified lines
496 'inc': '{{ item }}',497 'main': '{% for item in [1, 2, 3] %}{% include "inc" %}{% endfor %}',498 }))499 assert env.get_template('main').render() == '123'500501 def test_grouper_repr(self):502 from jinja2.filters import _GroupTuple503 t = _GroupTuple('foo', [1, 2])504 assert t.grouper == 'foo'505 assert t.list == [1, 2]506 assert repr(t) == "('foo', [1, 2])"
modified:CHANGES+7 added
7 unmodified lines
8- Added a new extension node called `OverlayScope` which can be used to9 create an unoptimized scope that will look up all variables from a10 derived context.1112Version 2.9.513-------------14(bugfix release, no release date yet)1516- Restored the original repr of the internal `_GroupTuple` because this17 caused issues with ansible and it was an unintended change. (#654)1819Version 2.9.420-------------21(bugfix release, released on January 10th 2017)22
479 unmodified lines