Standardize naming of FilterSet classes #3043

Closed
opened 2025-12-29 18:25:06 +01:00 by adam · 3 comments
Owner

Originally created by @jeremystretch on GitHub (Dec 5, 2019).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Ensure that all child classes of Django's FilterSet class end in FilterSet (not just Filter) and rename the filter property on view classes to filterset.

Justification

This makes for cleaner code and should help reduce confusion when distinguishing between a filter set and individual filters.

Originally created by @jeremystretch on GitHub (Dec 5, 2019). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Ensure that all child classes of Django's `FilterSet` class end in `FilterSet` (not just `Filter`) and rename the `filter` property on view classes to `filterset`. ### Justification This makes for cleaner code and should help reduce confusion when distinguishing between a filter set and individual filters.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 18:25:06 +01:00
adam closed this issue 2025-12-29 18:25:06 +01:00
Author
Owner

@hSaria commented on GitHub (Jan 3, 2020):

Can I take a swing at this or would you prefer to do it yourself (you know the project more so you may notice other things to change while fixing this issue)?

Also, do you want to wait until after v2.7 before doing this? I imagine merging this change into develop-2.7 would be a mess of conflicts and would probably miss a couple of new filters only present in v2.7.

@hSaria commented on GitHub (Jan 3, 2020): Can I take a swing at this or would you prefer to do it yourself (you know the project more so you may notice other things to change while fixing this issue)? Also, do you want to wait until after v2.7 before doing this? I imagine merging this change into `develop-2.7` would be a mess of conflicts and would probably miss a couple of new filters only present in v2.7.
Author
Owner

@jeremystretch commented on GitHub (Jan 3, 2020):

I'll take this on. It needs to be coordinated carefully to avoid invalidating other work. Thanks though!

@jeremystretch commented on GitHub (Jan 3, 2020): I'll take this on. It needs to be coordinated carefully to avoid invalidating other work. Thanks though!
Author
Owner

@jeremystretch commented on GitHub (Jan 10, 2020):

Merged into develop-2.7

@jeremystretch commented on GitHub (Jan 10, 2020): Merged into `develop-2.7`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3043