Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximillian Dornseif committed Nov 11, 2013
1 parent 856d7ea commit 5acc955
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gaetk/jinja_filters.py
Expand Up @@ -74,6 +74,7 @@ def make_attrgetter(environment, attribute):
if not isinstance(attribute, basestring) or '.' not in attribute:
return lambda x: environment.getitem(x, attribute)
attribute = attribute.split('.')

def attrgetter(item):
for part in attribute:
item = environment.getitem(item, part)
Expand All @@ -96,6 +97,7 @@ class _GroupTuple(tuple):
def __new__(cls, (key, value)):
return tuple.__new__(cls, (key, list(value)))


def plural(value, singular_str, plural_str):
"""Return value with singular or plural form"""
if not isinstance(value, (int, long)):
Expand Down

0 comments on commit 5acc955

Please sign in to comment.