Skip to content

Follow-up fixes to default filters #994

@mihow

Description

@mihow

Summary

Several small issues were discovered related to the default filters recently introduced in #951 & #954.

Detailed Description

Implementation Details

Each issue has a different implementation.

  1. Add the reusable filter method to the query used for chart data (check the project summary charts as well)

  2. Add a migration, add environment variables similar to default pipelines for default include & excludes. Create a new get_project_default_filters function to read those variables and call it from the get_or_create_default_project function to set the default filter fields in the ProjectSettingsMixin

  3. Multiple options. Remove cached values if the query can be fast enough to be dynamic, or bust the cache of these values when the filters are changed (perhaps a signal that checks if the default filter values were modified, then resave related models that have cached counts of occurrences or taxa)

  4. Add the apply_defaults query param to the taxa detail page (with the other filter query params) - ensure the get_queryset for the detail view action ignores apply_defaults (or defaults to False). Move this queryset filter under the list view conditional.

I recommend fixing 1 & 4 first. Then another PR(s) for 2 & 3

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions