django-stubs icon indicating copy to clipboard operation
django-stubs copied to clipboard

PEP-484 stubs for Django

Results 301 django-stubs issues
Sort by recently updated
recently updated
newest added

# Bug report ## What's wrong When we use queryset methods like `.filter()`, the query isn't used to narrow the type of the model. Is this supposed to work, or...

bug

# Bug report ## What's wrong FormMixin's get_form says it returns in instance of BaseForm ## How is that should be It should return either an instance of the class...

bug

```python class Question(models.Model): ... class Choice(models.Model): question_id = models.ForeignKey(Question,on_delete=models.CASCADE,related_name='choice_set') ... ``` django-stubs isn't able to recognise choice_set as a member of Question model. ```python reveal_type(question.choice_set.create(choice_text='django')) ``` Throws error `"Question" has...

# Bug report ## What's wrong I have view class in [django-hordak](https://github.com/adamcharnock/django-hordak/blob/1.10.0/hordak/views/accounts.py#L76) defined as: ```python class AccountTransactionsView(LoginRequiredMixin, SingleObjectMixin, ListView): ... ``` Which gives the following mypy errors: ``` # mypy...

bug

# Bug report ## What's wrong Mypy crashes with an assertion error if a variable has a union type of two different, custom querysets. I have a branch with a...

bug

# Bug report ## What's wrong The recent addition of Sequence for BaseListView.object_list breaks code that expects it to be a QuerySet (which is the default behaviour in Django CBVs,...

bug

# Bug report ## What's wrong Right now `django-stubs` requires that the return type of a `views.generic.ListView` subclass' `get_queryset` method be a queryset, which seems reasonable. However, `django` doesn't actually...

bug

Which can return either a `QuerySet` or an iterable. See, e.g. https://github.com/django/django/blob/83c803f161044fbfbfcd9a0c94ca93dc131be662/django/views/generic/list.py#L26-L27 This has been true for the generic `ListView` class since at least Django 1.7: https://github.com/django/django/blob/1.6/django/views/generic/list.py#L24-L27 Happy to write...

# Bug report ## What's wrong `as_manager()` on querysets currently uses `Any` instead of `_T`. Like so: ```python # django-stubs/db/models/query.pyi @classmethod def as_manager(cls) -> Manager[Any]: ... ``` ## How is...

bug

# Bug report ## What's wrong If I use `request.user.groups.all()` in a view (request being an instance of `django.http.HttpRequest`), this runs fine but mypy complains with `error: Item "ManyToManyField[Sequence[Group], RelatedManager[Group]]"...

bug