@@ -88,8 +88,9 @@ Usage examples::
88
88
Accepts a list of at least two text fields or expressions and returns the
89
89
concatenated text. Each argument must be of a text or char type. If you want
90
90
to concatenate a ``TextField()`` with a ``CharField()``, then be sure to tell
91
- Django that the ``output_field`` should be a ``TextField()``. This is also
92
- required when concatenating a ``Value`` as in the example below.
91
+ Django that the ``output_field`` should be a ``TextField()``. Specifying an
92
+ ``output_field`` is also required when concatenating a ``Value`` as in the
93
+ example below.
93
94
94
95
This function will never have a null result. On backends where a null argument
95
96
results in the entire expression being null, Django will ensure that each null
@@ -102,8 +103,11 @@ Usage example::
102
103
>>> from django.db.models.functions import Concat
103
104
>>> Author.objects.create(name='Margaret Smith', goes_by='Maggie')
104
105
>>> author = Author.objects.annotate(
105
- ... screen_name=Concat('name', V(' ('), 'goes_by', V(')'),
106
- ... output_field=CharField())).get()
106
+ ... screen_name=Concat(
107
+ ... 'name', V(' ('), 'goes_by', V(')'),
108
+ ... output_field=CharField()
109
+ ... )
110
+ ... ).get()
107
111
>>> print(author.screen_name)
108
112
Margaret Smith (Maggie)
109
113
0 commit comments