First error in first_matching_compare documentation

This commit is contained in:
Charles Haley 2014-05-10 12:13:43 +02:00
parent dfc0923db1
commit 8f7c23816d
2 changed files with 2 additions and 2 deletions

View File

@ -254,7 +254,7 @@ The following functions are available in addition to those described in single-f
``first_matching_cmp(10,5,"small",10,"middle",15,"large","giant")`` ``first_matching_cmp(10,5,"small",10,"middle",15,"large","giant")``
returns "middle". The same example with a first value of 16 returns "giant". returns "large". The same example with a first value of 16 returns "giant".
* ``first_non_empty(value, value, ...)`` -- returns the first value that is not empty. If all values are empty, then the empty value is returned. You can have as many values as you want. * ``first_non_empty(value, value, ...)`` -- returns the first value that is not empty. If all values are empty, then the empty value is returned. You can have as many values as you want.
* ``format_date(x, date_format)`` -- format_date(val, format_string) -- format the value, which must be a date field, using the format_string, returning a string. The formatting codes are:: * ``format_date(x, date_format)`` -- format_date(val, format_string) -- format the value, which must be a date field, using the format_string, returning a string. The formatting codes are::

View File

@ -187,7 +187,7 @@ class BuiltinFirstMatchingCmp(BuiltinFormatterFunction):
'the first comparison that succeeds. Returns else_result ' 'the first comparison that succeeds. Returns else_result '
'if no comparison succeeds. Example: ' 'if no comparison succeeds. Example: '
'first_matching_cmp(10,5,"small",10,"middle",15,"large","giant") ' 'first_matching_cmp(10,5,"small",10,"middle",15,"large","giant") '
'returns "middle". The same example with a first value of 16 returns "giant".') 'returns "large". The same example with a first value of 16 returns "giant".')
def evaluate(self, formatter, kwargs, mi, locals, *args): def evaluate(self, formatter, kwargs, mi, locals, *args):
if (len(args) % 2) != 0: if (len(args) % 2) != 0: