﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35426	`GenericPrefetch` should have `queryset` parameter as required	Sobolev Nikita	Sobolev Nikita	"Original issue: https://code.djangoproject.com/ticket/33651

Source: https://github.com/django/django/blob/91a4b9a8ec2237434f06866f39c7977e889aeae6/django/contrib/contenttypes/prefetch.py#L6-L7

Right now this code is really strange. It produces this result:


{{{
>>> import django
>>> from django.contrib.contenttypes.prefetch import GenericPrefetch
>>> GenericPrefetch('a')
Traceback (most recent call last):
  File ""<stdin>"", line 1, in <module>
  File ""/Users/sobolev/Documents/github/wemake-django-template/.venv/lib/python3.11/site-packages/django/contrib/contenttypes/prefetch.py"", line 7, in __init__
    for queryset in querysets:
TypeError: 'NoneType' object is not iterable
}}}


I guess that there are two ways:
- Using `if querysets is None: querysets = []`
- Requiring this argument, which I guess is the correct thing to do. Why would we ever want this field to be empty?

I will send a PR with the fix.

I found this while working on https://github.com/typeddjango/django-stubs/pull/2115"	Bug	closed	contrib.contenttypes	5.0	Release blocker	fixed		Sobolev Nikita	Ready for checkin	1	0	0	0	1	0
