blue-gold-89534
01/14/2022, 6:56 PMhtml
<table>
<tr id="editProductRow"
hx-target="#editProductRow"
hx-encoding="multipart/form-data"
hx-swap="outerHTML"
hx-include="#editProductRow"
hx-trigger="click target:#submitbutton">
{% for field in form %}
<td>{{ field }}</td>
{% endfor %}
<td class="text-end">
<button type="submit"
class="btn btn-success"
id="submitbutton">
OK
</button>
</td>
</tr>
</table>
does not work (but I thought it would):
html
<table>
<tr id="editProductRow"
hx-target="#editProductRow"
hx-encoding="multipart/form-data"
hx-swap="outerHTML"
hx-include="this" comment="<------"
hx-trigger="click[showEditButtons()] target:#submitbutton">
{% for field in form %}
<td>{{ field }}</td>
{% endfor %}
<td class="text-end">
<button type="submit"
class="btn btn-success"
id="submitbutton">
OK
</button>
</td>
</tr>
</table>
best-garage-8297
01/14/2022, 7:00 PMbest-garage-8297
01/14/2022, 7:01 PMhtml
<tr data-toggle="modal" data-target="#FormSetModal"
id="form-{{ form.prefix }}"
hx-get="{% url 'nfe-item' %}"
hx-target="#FormSetModal .modal-body"
hx-inlcude="#form-{{ form.prefix }}"
>
<td>{{ item.product.description }}</td>
<td>{{ item.quantity }}</td>
<td>{{ item.value }}</td>
{% hidden_form_fields form %}
</tr>
best-garage-8297
01/14/2022, 7:06 PMechoing-magazine-16041
01/14/2022, 7:12 PMhx-inlcude
instead of hx-include
best-garage-8297
01/14/2022, 7:13 PMbest-garage-8297
01/14/2022, 7:13 PMechoing-magazine-16041
01/14/2022, 7:13 PMprehistoric-cat-63987
01/18/2022, 7:02 AMplain-kangaroo-26043
01/18/2022, 9:35 AMprehistoric-cat-63987
01/19/2022, 7:46 AMfresh-controller-36545
01/19/2022, 8:22 AMcalm-motorcycle-68687
01/19/2022, 12:32 PMprehistoric-cat-63987
01/19/2022, 12:39 PMsalmon-xylophone-28580
01/20/2022, 11:01 AMblue-gold-89534
01/20/2022, 12:02 PMbland-coat-6833
01/20/2022, 12:18 PMbland-coat-6833
01/20/2022, 12:22 PMblue-gold-89534
01/20/2022, 12:35 PMsalmon-xylophone-28580
01/20/2022, 1:36 PMacoustic-lawyer-26558
01/20/2022, 2:09 PMfresh-controller-36545
01/20/2022, 2:49 PMinput
/ way the filter is parametrized.fresh-controller-36545
01/20/2022, 2:54 PMsearch_fields
in the correlating model admin.salmon-xylophone-28580
01/20/2022, 3:04 PMfancy-twilight-24901
01/20/2022, 7:33 PMfancy-twilight-24901
01/20/2022, 7:33 PMcalm-motorcycle-68687
01/20/2022, 8:39 PMbitter-family-65697
01/21/2022, 8:53 AMdef dispatch(self, request, *args, **kwargs):
if 'click' in request.POST:
return render(request, self.some_template_name,)
I want to catch different queries in one view.
Is it at all possible or do I have to write a separate view for it?
Thx for help and have a nice day πplain-kangaroo-26043
01/21/2022, 9:24 AMbland-coat-6833
01/21/2022, 9:39 AMhtmx
property on the request that you can check.