diff options
| author | Tim Graham <timograham@gmail.com> | 2016-10-07 10:24:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-07 10:24:45 -0400 |
| commit | c60feb6999f83bfd1fdabff01f0dd4a26d72e158 (patch) | |
| tree | d00305f26d414eb6241ae44ef1eb51cf4b0eac4f /docs | |
| parent | f8deed7199ff35434d668d8d917a7ceed52023e7 (diff) | |
Fixed #25475 -- Doc'd how to use a literal % in Func.template.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/expressions.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 667285adbb..66bb905147 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -259,6 +259,12 @@ The ``Func`` API is as follows: generated for this function. Defaults to ``'%(function)s(%(expressions)s)'``. + If you're constructing SQL like ``strftime('%W', 'date')`` and need a + literal ``%`` character in the query, quadruple it (``%%%%``) in the + ``template`` attribute because the string is interpolated twice: once + during the template interpolation in ``as_sql()`` and once in the SQL + interpolation with the query parameters in the database cursor. + .. attribute:: arg_joiner A class attribute that denotes the character used to join the list of |
