(self, *args: Any)
| 591 | return dict(path_args=path_args, path_kwargs=path_kwargs) |
| 592 | |
| 593 | def reverse(self, *args: Any) -> Optional[str]: |
| 594 | if self._path is None: |
| 595 | raise ValueError("Cannot reverse url regex " + self.regex.pattern) |
| 596 | assert len(args) == self._group_count, ( |
| 597 | "required number of arguments " "not found" |
| 598 | ) |
| 599 | if not len(args): |
| 600 | return self._path |
| 601 | converted_args = [] |
| 602 | for a in args: |
| 603 | if not isinstance(a, (unicode_type, bytes)): |
| 604 | a = str(a) |
| 605 | converted_args.append(url_escape(utf8(a), plus=False)) |
| 606 | return self._path % tuple(converted_args) |
| 607 | |
| 608 | def _find_groups(self) -> Tuple[Optional[str], Optional[int]]: |
| 609 | """Returns a tuple (reverse string, group count) for a url. |
nothing calls this directly
no test coverage detected