Replace all instances of .extra() in QuerySets with annotations #2559

Closed
opened 2025-12-29 18:19:57 +01:00 by adam · 2 comments
Owner

Originally created by @jeremystretch on GitHub (Apr 27, 2019).

Proposed Changes

There are several instances where .extra() is used to extend a QuerySet. These should be replaced with .annotate() using RawSQL where necessary.

Justification

.extra() is planned for deprecation.

Originally created by @jeremystretch on GitHub (Apr 27, 2019). ### Proposed Changes There are several instances where `.extra()` is used to extend a QuerySet. These should be replaced with `.annotate()` using `RawSQL` where necessary. ### Justification `.extra()` is [planned for deprecation](https://docs.djangoproject.com/en/2.2/ref/models/querysets/#extra).
adam added the status: acceptedtype: housekeeping labels 2025-12-29 18:19:57 +01:00
adam closed this issue 2025-12-29 18:19:57 +01:00
Author
Owner

@KhaledTo commented on GitHub (Jun 5, 2019):

Would like to have a look at this.

@KhaledTo commented on GitHub (Jun 5, 2019): Would like to have a look at this.
Author
Owner

@kobayashi commented on GitHub (Oct 10, 2019):

closed in e223c88

@kobayashi commented on GitHub (Oct 10, 2019): closed in e223c88
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2559