Oct 19, 20226:08 AM - edited Oct 19, 20227:01 AM
Member
Filter hubDB Data with select list by month and year with pagination
I done the pagination part but facing issues with select list with filter. I tries with choice but now How can I filter the data using the url
Thanks in advance 🙂
My code is below :
<h1>DB Filter Demo</h1>
{# Set your HubDB ID. There is a field (HubDB table) to make the user choose. If it's empty, it will display the default #} {% set db = module.db || '5533038' %}
{% set queryparam = "" %}
{# Check if the query_dict of pubtype contains the existing pubtypes of the HubDB column options and append it to the queryparam #} {% if request.query_dict.month in types|map('id') %} {# Set new queryparam by adding the pubtype #} {% set queryparam = queryparam ~ "&month="~request.query_dict.month|urlencode %} {% endif %}