From 6534a95ac3142ff79f8152b0d5dcbf9330d8abde Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 18 Dec 2012 06:52:30 -0500 Subject: [PATCH] Fixed #19470 - Clarified widthratio example. Thanks orblivion for the suggestion. --- django/template/defaulttags.py | 8 ++++---- docs/ref/templates/builtins.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index aca2f41f2db..b5c8cf2d36f 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -1319,11 +1319,11 @@ def widthratio(parser, token): For example:: - + - Above, if ``this_value`` is 175 and ``max_value`` is 200, the image in - the above example will be 88 pixels wide (because 175/200 = .875; - .875 * 100 = 87.5 which is rounded up to 88). + If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, + the image in the above example will be 88 pixels wide + (because 175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88). """ bits = token.contents.split() if len(bits) != 4: diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 57ef0cfb274..dd288ababcd 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1079,11 +1079,11 @@ value to a maximum value, and then applies that ratio to a constant. For example:: Bar + height="10" width="{% widthratio this_value max_value max_width %}" /> -Above, if ``this_value`` is 175 and ``max_value`` is 200, the image in the -above example will be 88 pixels wide (because 175/200 = .875; .875 * 100 = 87.5 -which is rounded up to 88). +If ``this_value`` is 175, ``max_value`` is 200, and ``max_width`` is 100, the +image in the above example will be 88 pixels wide +(because 175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88). .. templatetag:: with