目前,我正在使用非硬编码的url通过匹配条形码编号将用户重定向到具有类似产品的页面。在
视图.pydef ItemView(request, barcode):
template_name = "TESTcategories.html"
products = Product.objects.filter(barcode=barcode)
context = {
'products': products,
}
return render_to_response(template_name, context)
网址.py
^{pr2}$
项目.html
{{result.object.title}}
我根据URL模式传递条形码参数。我是否可以达到类似的效果,但对于“快速查看”选项,将启动弹出模式视图。
这是我的潜在模式:
部分/模态.html
编辑:在我的模态.html结果在页面上迭代_目标对象清单因为我用djang haystack和弹性搜索。在