django参数通过get在形成直接url时不起作用
基本URL:django参数通过get在形成直接url时不起作用,django,django-urls,Django,Django Urls,基本URL: path('api/product/', include(('store.urls', 'store'), namespace='api-product')), path('invoice-pdf-get/', invoice.InvoiceToPdf.as_view(), name='invoice-pdf-get'), 商店URL: path('api/product/', include(('store.urls', 'store'), namespace='api-pr
path('api/product/',
include(('store.urls', 'store'),
namespace='api-product')),
path('invoice-pdf-get/',
invoice.InvoiceToPdf.as_view(),
name='invoice-pdf-get'),
商店URL:
path('api/product/',
include(('store.urls', 'store'),
namespace='api-product')),
path('invoice-pdf-get/',
invoice.InvoiceToPdf.as_view(),
name='invoice-pdf-get'),
HTML:
path('api/product/',
include(('store.urls', 'store'),
namespace='api-product')),
path('invoice-pdf-get/',
invoice.InvoiceToPdf.as_view(),
name='invoice-pdf-get'),
通过GET提交表单时,表单中的值将作为查询字符串发送。这将覆盖
操作
URL中的任何查询字符串。例如,见
您应该将您的值作为隐藏输入放入表单本身
<form method="get" action="{% url 'api-product:invoice-pdf-get' %}">
<input type="hidden" name="R" value="{{ invoice.invoice_unique_number }}">
<input type="submit" value="Generate PDF">
</form>
谢谢您的澄清,先生!