summaryrefslogtreecommitdiff
path: root/django/forms/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms/utils.py')
-rw-r--r--django/forms/utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py
index 3d87afd8c9..dc4df86058 100644
--- a/django/forms/utils.py
+++ b/django/forms/utils.py
@@ -16,6 +16,13 @@ except ImportError: # Python 2
from UserList import UserList
+def pretty_name(name):
+ """Converts 'first_name' to 'First name'"""
+ if not name:
+ return ''
+ return name.replace('_', ' ').capitalize()
+
+
def flatatt(attrs):
"""
Convert a dictionary of attributes to a single string.