In html file I have this code, which print out information of golfelement such as golfname, changenamefee, url_1net, url_golfagora, url_juchi. I also get the golfelement ID by {{golfelement.key().id()}}. There is a button 1net, if I click the button, it will request myapp/affiliate
{% for golfelement in displaygolf %}
<tr>
<td></td>
<td>{{ golfelement.golfname }}</td>
<td>{{ golfelement.changenamefee }}</td>
<td>
<a href="{{golfelement.url_1net}}">1net | </a>
<a href="{{golfelement.url_golfagora}}">Golfagora | </a>
<a href="{{golfelement.url_juchi}}">Juchi</a>
{{golfelement.key().id()}}
<form method="LINK" action="{{url_for('myapp/affiliate')}}">
<input type="submit" value="1net">
</form>
</td>
</tr>
{% endfor %}
I want to send {{golfelement.key().id()}} to a function affiliate(request, idnum) in views.py when I click button.
def affiliate(request, idnum):
golfe = Golf.get_by_id(idnum)
return render_to_response('myapp/affiliate.html',{'affiliate': golfe})
Please help me how to modify the html file to send the parameter {{golfelement.key().id()}}
Then your view: