Peter Schutt

Results 61 issues of Peter Schutt

This issue is for tracking work still to be completed for rollout of the reference api docs.

documentation
enhancement
help wanted
good first issue

In `LifecycleHook` we eagerly evaluate whether a callable is async or sync, so that we don't need to do that for every call to the handler around every request. Guards...

enhancement

Objective is to ensure that the examples in the docs do not become stale as the library evolves. Leveraging `pymdownx.snippets` mkdocs markdown extension allows us to move the examples into...

documentation
enhancement
help wanted
good first issue

We should provide a link to the example project(s) from the docs and readme to make it more apparent to users that they exist.

documentation

Thinking about ways to make parameter specification and parsing / validation available to the middleware stack. Perhaps something like: ```python @runtime_checkable class MiddlewareProtocol(Protocol): parameters: dict[str, tuple] = {"middleware_required_header": (int, Parameter(header="required-header"))}...

enhancement

This comes out of an issue with generics in #138. Generics are a tricky space for pydantic to operate within, and there will always be edge cases, or they will...

enhancement

Version 1.4.0 of DRF-stubs and Following along with the DRF tutorial I've got the following pattern (mypy output inline in comments): ```python urlpatterns = [ path("tree/", views.NodeList.as_view()), path("tree/", views.NodeDetail.as_view()), ]...

bug

In `method_overridden()`, the `instance` arg is typed as `Model`: https://github.com/typeddjango/djangorestframework-stubs/blob/466b1f5f0dd2f80eea6fcebb13114118489686a7/rest_framework-stubs/relations.pyi#L9 However, [the only time the func is called in drf source](https://github.com/encode/django-rest-framework/search?q=method_overridden) is in [`RelatedField.__init__()`](https://github.com/encode/django-rest-framework/blob/0323d6f8955f987771269506ca5da461e2e7a248/rest_framework/relations.py#L106) checking that `get_queryset()` is overridden: ```py...

Define `urlpatterns` as `Iterable`, they are only iterated over inside `apply_suffix_patterns`. Define `allowed` as `Optional[Sequence[...]]` instead as it is documented as tuple/list and needs to support `__len__` and `__getitem__`. Closes...

I spent some time trying to get the tests to run. Apart from pointing `django-stubs` at https://github.com/typeddjango/django-stubs/pull/786, I had to make two more changes 1. `types-requests` no longer vendors `urllib3`...