-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The datatables already have support for automatic sorting and searching when the base model of the table is known.
In addition to that it would be very nice to have automated way to create forms for filtering.
The following python package is very helpfull for exactly this task: https://django-filter.readthedocs.io/
I suggest we have two ways to specify filter fields:
- Through an additional attribute of DataTableColumn, which can be detected automatically (when the column is only a string which represents the field-name) or specified manually (same behaviour as sortingname)
- By passing one or multiple custom FilterSet to the browseview, with an additional attribute for it. Multiple FilterSets could be chained via an "or" operation
Some more information:
- The layout for the filters should be generated automatically
- The form can be accessed via a FilterSet instance (filterset.form)
- We should always set a prefix to FilterSet, so that the parameters which are passed in the URL have a prefix. This would also allow for multiple datatables on the same page to be filterable.
- The browse view is responsible for filtering
Metadata
Metadata
Assignees
Labels
No labels