mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #25629 -- Added arity
class attribute to Func
expressions
This commit is contained in:
parent
03c6ad7ad4
commit
0a26121797
6 changed files with 27 additions and 10 deletions
|
@ -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``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue