Skip to content

Commit

Permalink
Add another overload to path function (#234)
Browse files Browse the repository at this point in the history
Allows to pass NinjaAPI's ``.urls`` to Django's ``path`` function.

Adding ``URLPattern`` to ``IncludedURLConf`` didn't work. My guess is that this is caused by the `str | None` in ``IncludedURLConf`` which is not as strict as the return type of ``ninja_api.urls``

fixes #173
  • Loading branch information
3wille authored Apr 15, 2024
1 parent 8508231 commit 01e4eb5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions django-stubs/urls/conf.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ def path(
kwargs: dict[str, Any] = ...,
name: str = ...,
) -> URLResolver: ...
@overload
def path(
route: str,
view: tuple[list[URLResolver | URLPattern], str, str],
kwargs: dict[str, Any] = ...,
name: str = ...,
) -> URLResolver: ...

# re_path()
@overload
Expand Down

0 comments on commit 01e4eb5

Please sign in to comment.