I have a form in Django and would like to add the correct id at the end of the URL. I am not sure how to add the ID at the end dynamically however. Here's some example code.
{% for dealer_payment_account in dealer.dealerpaymentaccount_set.all %}
<p>Account: {{ dealer_payment_account.last_4_digits }}</p>
<form id="verifyDealerBankAccountForm" action="/verify-dealer-payment-account/{{ dealer_payment_account.id }}" method="POST">
<div class="form-row">
<label>Payment</label>
<input type="text" name="amount">
</div>
<button type="submit">Submit</button>
</form>
{% endfor %}
Specifically I am wondering how to format this:
action="/verify-dealer-payment-account/{{ dealer_payment_account.id }}"
so that I can add the dealer_payment_accound.id to the end of each form.
Here is the URL:
url(r'^verify-dealer-payment-account/(?P<account_number>[0-9]+)/$', verify_dealer_payment_account),