~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlpoll/views.py

  • Committer: Holger Rapp
  • Date: 2009-03-28 12:03:48 UTC
  • Revision ID: sirver@kallisto.local-20090328120348-id7kvvww2nxhauwd
First draft version of wlpoll, a poll application

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.shortcuts import render_to_response, get_object_or_404
 
2
from django.template import RequestContext
 
3
 
 
4
from models import Poll, Choice
 
5
 
 
6
def view(request, poll_id ):
 
7
    p = get_object_or_404(Poll,pk=poll_id)
 
8
    
 
9
    template_data = {
 
10
        "poll": p,
 
11
    }
 
12
 
 
13
    return render_to_response('poll/view.html', 
 
14
            template_data,
 
15
            context_instance=RequestContext(request))
 
16
 
 
17
def vote(request, poll_id, next = None):
 
18
    pass
 
19