【发布时间】:2020-07-10 12:39:58
【问题描述】:
** 网址:**
path('products_filter/', views.products_filter, name='products_filter'),
** 查看:**
def products_filter(request):
product = request.GET.get('product')
selling = request.GET.get('selling')
products = Product.objects.filter(selling='best_seller')
return render(request, 'product/products.html', {'products':products})
** 模板:**
<a href="/product/products_filter?product={{'carpet'|urlencode}}&selling={{'best_seller'|urlencode}}">
【问题讨论】:
-
我们可以看看你的模型吗?