opus_app.apps.results.templatetags

The template filters the results templates load.

The encode_value template filter.

The results templates load this filter to turn a metadata value into the query string of an OPUS search URL, so that a link built around the value searches for that exact value.

opus_app.apps.results.templatetags.encode_value.encode_value(value)[source]

Encode a search value for use in an OPUS URL.

Parameters:

value (str | None) – The value to encode, or None.

Returns:

The value percent-encoded for use in a URL, with spaces written as + and the characters -_.!~*’() left alone. None is encoded as the text NULL.

Return type:

str