Ticket #2489: capfirst.diff
File capfirst.diff, 671 bytes (added by , 18 years ago) |
---|
-
www-libs/django/django/template/defaultfilters.py
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):