8000 PyCharm gets weird about self.request.GET.get · Issue #799 · typeddjango/django-stubs · GitHub
[go: up one dir, main page]

Skip to content
PyCharm gets weird about self.request.GET.get #799
@Crocmagnon

Description

@Crocmagnon

Bug report

What's wrong

class ArticleDetailView(generic.DetailView):
    model = Article

    def get_queryset(self):
        key = self.request.GET.get("draft_key")

Screenshot 2021-12-28 at 23 22 50

PyCharm complains about the types here, even though mypy doesn't.

Hinting request: WSGIRequest solves the issue with PyCharm though.

How is that should be

There should not be any issue with the types. Is PyCharm wrong about complaining here? Is django-stubs wrong about typing request with HttpRequest and not something else like WSGIRequest?

System information

  • OS: macOS 12.1 (21C52)
  • python version: Python 3.10.0
  • django version: 4.0
  • mypy version: mypy 0.930
  • django-stubs version: 1.9.0
  • django-stubs-ext version: 0.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0