mirror of
https://github.com/django/django.git
synced 2025-09-21 18:00:45 +00:00
Decorated a few functions.
This commit is contained in:
parent
cbae4d3184
commit
6072de727f
3 changed files with 7 additions and 9 deletions
|
@ -20,10 +20,11 @@ if six.PY2:
|
|||
from django.utils.encoding import force_unicode # NOQA
|
||||
|
||||
|
||||
# Capitalizes the first letter of a string.
|
||||
@keep_lazy_text
|
||||
def capfirst(x):
|
||||
"""Capitalize the first letter of a string."""
|
||||
return x and force_text(x)[0].upper() + force_text(x)[1:]
|
||||
capfirst = keep_lazy_text(capfirst)
|
||||
|
||||
|
||||
# Set up regular expressions
|
||||
re_words = re.compile(r'<.*?>|((?:\w[-\w]*|&.*?;)+)', re.U | re.S)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue