Sorted it with a very simple form in template. The submit buttons trigger a views.vote function by url, the views.vote detects up or down button names, and saves a vote to the entry referenced by entryid. This is brought in by a POST.get on the hidden name in the template form.
Lastly, a redirect keeps it all on one page and refreshes the index.
template
<ul>
{% for entry in voting_entry_list %}
<li><a href="/entries/{{ entry.id }}/">{{ entry.text }}{{ entry.score }}</a></li>
<li><form method="POST" action="/vote/" >
{% csrf_token %}
<input type="hidden" name="voteid" value="{{ entry.id }}" />
<input type="submit" name='voteup' value="Up" />
<input type="submit" name='votedown' value="Down" />
</form><li>
{% endfor %}
</ul>
urls
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^index/$', 'entries.views.index'),
url(r'^add/$', 'entries.views.add'),
url(r'^vote/$', 'entries.views.vote')
)
views
@csrf_protect
def vote(request):
voting_id = request.POST.get('voteid',None)
if request.method=='POST':
if 'voteup' in request.POST:
v = Entry.objects.get(pk=voting_id)
v.score +=1
v.save()
if 'votedown' in request.POST:
v = Entry.objects.get(pk=voting_id)
v.score -=1
v.save()
else:
pass
return HttpResponseRedirect('/index')
My final issue was having to take the quotes off the - pk=voting_id - to prevent an error of "invalid literal for int() with base 10".
Hope this helps someone else who just wants to start with these systems in a basic manner, but something not quite the same as the django polls tutorials. It was a bit tough wading through the various methods of doing it (JSON, js, POST, forms, regex, urls, etc.), so here is the way I did it with various snippets from many SO questions.