diff options
| author | Rohith PR <praroh2@gmail.com> | 2021-02-25 13:18:55 +0530 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-02 12:24:49 +0100 |
| commit | d3ecef26b9fda02b88f925a800ae38dd5873c878 (patch) | |
| tree | 1d065760d3f155452afeabe472859ac8e703c308 /django/template | |
| parent | 5fd4f22d196fbe9913884259ddedad10e6156a44 (diff) | |
Refs #24121 -- Added __repr__() to URLNode.
Diffstat (limited to 'django/template')
| -rw-r--r-- | django/template/defaulttags.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index cb1f1e91f1..36ad923a5a 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -406,6 +406,15 @@ class URLNode(Node): self.kwargs = kwargs self.asvar = asvar + def __repr__(self): + return "<%s view_name='%s' args=%s kwargs=%s as=%s>" % ( + self.__class__.__qualname__, + self.view_name, + repr(self.args), + repr(self.kwargs), + repr(self.asvar), + ) + def render(self, context): from django.urls import NoReverseMatch, reverse args = [arg.resolve(context) for arg in self.args] |
