passing variables between methods in class based view

The way your code is written, there will always be a dict named filters. But you’re currently defining filters as a local variable, not as a member variable of the class.

If you want to specifically track filters in the class, define (and use) it as self.filters.

Or, you could set saved as a member variable and test it where needed.

Or, you could check self.request.GET in multiple places.

1 Like