diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2015-10-31 15:01:08 +0500 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-11-02 20:09:21 +0100 |
| commit | 0a26121797b5e0aa07ada07fe1577a79d3853c40 (patch) | |
| tree | 2c19e8bb72ab937225804c9aa0a0f6b4693c311e /docs | |
| parent | 03c6ad7ad44032206a8780f74c693d16ca1f1a37 (diff) | |
Refs #25629 -- Added `arity` class attribute to `Func` expressions
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/expressions.txt | 9 | ||||
| -rw-r--r-- | docs/releases/1.10.txt | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 87c3108509..98ba323171 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -252,6 +252,15 @@ The ``Func`` API is as follows: A class attribute that denotes the character used to join the list of ``expressions`` together. Defaults to ``', '``. + .. attribute:: arity + + .. versionadded:: 1.10 + + A class attribute that denotes the number of arguments the function + accepts. If this attribute is set and the function is called with a + different number of expressions, ``TypeError`` will be raised. Defaults + to ``None``. + The ``*expressions`` argument is a list of positional expressions that the function will be applied to. The expressions will be converted to strings, joined together with ``arg_joiner``, and then interpolated into the ``template`` diff --git a/docs/releases/1.10.txt b/docs/releases/1.10.txt index 8846dce242..20afbd93b8 100644 --- a/docs/releases/1.10.txt +++ b/docs/releases/1.10.txt @@ -175,6 +175,10 @@ Models accessible as a descriptor on the proxied model class and may be referenced in queryset filtering. +* The :attr:`~django.db.models.Func.arity` class attribute is added to + :class:`~django.db.models.Func`. This attribute can be used to set the number + of arguments the function accepts. + Requests and Responses ^^^^^^^^^^^^^^^^^^^^^^ |
