From 926e20fad179f5bf6a1ddf4e2fdbc672c175a7af Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 31 Jan 2009 14:19:57 +0100 Subject: [PATCH] Use force_unicode() instead of .__unicode__(). This allows the natural_list template tag to work for unicode strings as well, which have no __unicode__() method. --- tools/templatetags/list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/templatetags/list.py b/tools/templatetags/list.py index 70ce860..87d7976 100644 --- a/tools/templatetags/list.py +++ b/tools/templatetags/list.py @@ -43,12 +43,12 @@ def natural_list(list): for item in list[0:-1]: if res: res += ', ' - res += item.__unicode__() + res += force_unicode(item) if res: res += ' %s ' % _('and') - res += list[-1].__unicode__() + res += force_unicode(list[-1]) return res natural_list.is_safe = True -- 2.30.2