Ticket #2489: capfirst.diff
| File capfirst.diff, 0.7 kB (added by nesh <nesh [at] studioquattro [dot] co [dot] yu>, 2 years ago) |
|---|
-
/www-libs/django/django/template/defaultfilters.py
old new 19 19 20 20 def capfirst(value): 21 21 "Capitalizes the first character of the value" 22 value = str(value) 22 if isinstance(value, str): 23 # convert to unicode string 24 value = unicode(value, settings.DEFAULT_CHARSET) 25 elif not isinstance(value, basestring): 26 value = unicode(value) 23 27 return value and value[0].upper() + value[1:] 24 28 25 29 def fix_ampersands(value):
