Update RestrictedPrefetch for compatiblity with Django 5.0 #9664

Closed
opened 2025-12-29 21:20:37 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (May 13, 2024).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Update our custom subclass of Django's Prefetch class to work with Django 5.0.

Justification

The get_current_queryset() method on Prefetch was deprecated in Django 5.0 as support for automatic prefetching across GenericForeignKey relationships was introduced.

Originally created by @jeremystretch on GitHub (May 13, 2024). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Update our custom subclass of Django's Prefetch class to work with Django 5.0. ### Justification The `get_current_queryset()` method on Prefetch was [deprecated](https://docs.djangoproject.com/en/5.0/releases/5.0/#id2) in Django 5.0 as support for automatic [prefetching across GenericForeignKey relationships](https://docs.djangoproject.com/en/5.0/releases/5.0/#django-contrib-contenttypes) was introduced.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:20:37 +01:00
adam closed this issue 2025-12-29 21:20:37 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9664