I’m creating a drop down filter from cities in a hubdb table and getting duplicates because of some are all uppercase and some are lowercase. How do I search for and group by city without case sensitivity?
If I change them all to group.grouper|upper then it the returned query only retrives those that are all upper and vice versa …
{% if request.query_dict.region gt '' %}
<div class="input-group-prepend">
<select id="city" name="city" class="form-control formInput">
<option value="" {% if request.query_dict.city eq '' %}selected="selected"{% endif %}>ALL CITIES</option>
{% for group in hubdb_table_rows(dynamic_page_hubdb_table_id,'limit=9999&orderBy=city'+queryparam_cs)|groupby("city") %}
<option value="{{ group.grouper}}"
{% if request.query_dict.city eq group.grouper %}selected="selected"{% endif %}
>{{ group.grouper}}</option>
{% endfor %}
</select>
</div>
{% endif %}
After this drop down based on the queryparam I then use ot to search the HUbdb