From e3968df527c4d378677f4784fb1bc0c86950fcf8 Mon Sep 17 00:00:00 2001 From: Tobias Kunze Date: Sat, 27 Apr 2019 18:08:39 +0200 Subject: [PATCH] Refs #20122 -- Corrected documentation of pluralize template filter. --- django/template/defaultfilters.py | 4 ++-- docs/ref/templates/builtins.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index ae76910a37..f82c08348a 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -851,8 +851,8 @@ def filesizeformat(bytes_): @register.filter(is_safe=False) def pluralize(value, arg='s'): """ - Return a plural suffix if the value is not 1. By default, use 's' as the - suffix: + Return a plural suffix if the value is not 1, '1', or an object of + length 1. By default, use 's' as the suffix: * If value is 0, vote{{ value|pluralize }} display "votes". * If value is 1, vote{{ value|pluralize }} display "vote". diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index cd5476fd6f..b004f9b34f 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1990,8 +1990,8 @@ If ``value`` is ``800-COLLECT``, the output will be ``800-2655328``. ``pluralize`` ------------- -Returns a plural suffix if the value is not 1. By default, this suffix is -``'s'``. +Returns a plural suffix if the value is not ``1``, ``'1'``, or an object of +length 1. By default, this suffix is ``'s'``. Example::