Query Syntax HUBDB

Hi Community,

I’m trying to filter a table I have using contain. The AssetClass column is TEXT. I want to display only rows that have the word Future-Index and Commodity.

I wrote the following but It doesn’t work. I don’t know how to use two different parameters for contains. Can anyone help me figure out? Thank you

{% set table = hubdb_table_rows(2595031,'assetclass__contains=Future-index,Commodity') %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}
<div class="card tblHolding" id="Holding">
<div class="card-body">
<!-- <h1>{{ module.heading }}<span>{{ module.sub_heading }}</span></h1> -->
<div class="card-text">
<div>
<div class="row">
<div class="custom-column">
<table class="table table-striped">
<thead>
<tr>
<th><span>Stockticker </span></th>
<th><span>Security Name</span></th>
<th><span>Shares </span></th>
<th><span>Price </span></th>
<th><span>Market Value</span></th>
<th><span>Weightings</span></th>
<th><span>Asset Class</span></th>

</tr>
</thead>
<tbody>

{% for item in table %}
<tr>
<td>{{ item.stockticker }}</td>
<td>{{ item.securityname }}</td>
<td>{{ item.shares }}</td>
<td>{{ item.price }}</td>
<td>{{ item.marketvalue }}</td>
<td>{{ item.weightings }}</td>
<td>{{ item.assetclass }}</td>
</tr>
{% endfor %}
</tbody>
</table> 
</div>
</div>
<div class="row bottom">
<div class="bottom-content"><h5>{{ module.bottom_text }}</h5></div>
</div>
</div>
</div>
</div>
</div>
{% endif %}

Hey @imerial ,

As far as I know you can’t use multiple parameters with contain. You could either create two separate table listings for each assetclass you want to list OR switch these columns to a SELECT option and use the in filter name.

{% set table = hubdb_table_rows(2595031,'assetclass__in=Future - Index,Commodity') %}