Lists
Filters
Filtering is possible according to nearly any variable in the list. To open the filter settings, click the filter icon in the upper left corner. Choose the parameters and then click Apply filter, this will set your filter for the current session (the filter will remain after leaving the page, but will reset after logging out).
The second option is the Quick search, which searches for a string in the name or the ID.
Active filters (both session and URL) are listed just above the list. The whole panel is hidden when there are no active filters. Individual filters can be cleared from this list, another option is to Clear all filters in the filter settings.
Default filters
When a filter is active, the user can click the Save button and save it as User default filter. Admins can also set an Instance default filter. Default filters are set up after logging in and are stored in the session. User settings are the primary source for the default filters, while the facility settings form the secondary source.
Both types of default filters use the same format of key: defaults.list.<page>.filter
(e.g. defaults.list.substock.filter
), the value is a JSONised dictionary attribute[__operator]: value
.
Custom filters
Another option when saving is the Custom filter. Each user can save the current filter settings as a custom filter and share them with others by setting the option public to the filter when saving.
After saving, a new field Load custom filter will appear in the filter settings. The user can select the custom filter by typing in its name or by selecting it from the drop-down menu. The filter is loaded by clicking the checkmark icon Load filter.
Custom filters can be managed in Admin/
Filter URL
Filtering can also be done using URL parameters. The user can get the URL of a currently used filter by clicking Get filter URL. URL filters have higher priority over the session filters and will be lost after leaving the page.
Filter format
The URL filter format is Django-based with one exception: negative filters end with !
, so for example status__in!
means "status not in ...". Values for the __in
operator are comma-separated.
Example:
JSON filter settings {"status__in!=dead,๐-split,๐-merged", "stock__date_of_birth__gte": "2010-01-01"}
corresponding URL filter /list/substock?status__in!=dead,๐-split,๐-merged&stock__date_of_birth__gte=2010-01-01
.
Special URL parameters
There are two special URL parameters related to filters. Parameter _url
omits all session filters so that only URL filters are used (this is used in generated links in Zebrabase). Parameter _all
displays all objects including any previously deleted objects.
Examples of use:
zebrabase.org/list/substock?_all
zebrabase.org/list/substock?_all&_url
zebrabase.org/list/substock?genotypes__isnull=True&_url
Columns
Columns to display in a list and their order can be organized in Column settings. The form is invoked by clicking the cog icon on the right side of the list toolbar.
If the column setting originates from the instance default the icon will change to:
If the setting is a personal default the icon will change to:
The form is divided into two panels, on the left side there are the active columns that will be displayed in your list, and on the right side there are the inactive columns. To display a column in your list, simply drag and drop it into any position in the left panel.
Column settings can be stored as Personal default by any user or as Instance default by the admin. The default user settings can be reverted from a confirmation message above the list or in the column settings.
The columns to be displayed are by default shown on both mobile and desk devices. Clicking the blue phone or PC icon will de-select the column from being displayed on that device.
Export
Filtered lists can be exported as .XLSX files by clicking the download icon in the upper right corner. The items in your list can be managed by the filter settings, however, column settings will not transfer into your exported file.
If you encounter problems with exporting, please check the length of your filtered list. Very long lists can have problems with export, and the option to export is not offered for excessively long lists.