#28129: Custom template tag keyword only arguments
-------------------------------------+-------------------------------------
Reporter: Alexander | Owner: nobody
Allakhverdiyev |
Type: Bug | Status: new
Component: Template | Version: master
system |
Severity: Normal | Keywords: template,inspect
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Example tag with a keyword-only argument
{{{
@register.simple_tag(takes_context=True)
def my_tag(context, arg1, *, kwarg2='n/a'):
return ''
}}}
Html code
{{{
<div>bla bla bla</div>
{% my_tag 'arg_1_value' kwarg_2='kwarg_value' %}
}}}
Result
{{{
ValueError: Function has keyword-only arguments or annotations, use
getfullargspec() API which can support them
}}}
Proposed solution: use getfullargspec instead of getargspec in
templates/base.py
--
Ticket URL: <https://code.djangoproject.com/ticket/28129>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.c671bbca07dbc9d4523fb5341ac28d0e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.