def show_table(request):
order_by = request.GET.get('orderby', settings.DEFAULT_ORDER)
some_data = SomeModel.objects.order_by(order_by)
return render(request, 'some_template.hmtl', {'rows': some_data})
<form>
<select name="orderby">
<option value="name">Наименование</option>
<option value="price">Цена</option>
<option value="quantity">Количество</option>
</select>
<input type="sumbit" value="Отсортировать">
</form>
<table>
<tr>
<th>Наименование</th>
<th>Цена</th>
<th>Количество</th>
</tr>
{% for row in rows %}
<tr>
<td>{{ row.name }}</td>
<td>{{ row.price }}</td>
<td>{{ row.quantity }}</td>
</tr>
{% endfor %}
</table>