Skip to content

Commit

Permalink
adding poll view to event page
Browse files Browse the repository at this point in the history
Signed-off-by: rimonsh <[email protected]>
  • Loading branch information
rimonsh committed May 17, 2023
1 parent 18e91ae commit 8c9d793
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions event/templates/event/event_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ <h2>{{event.name}} Event</h2>
<li>Starts At: {{event.start_time}}</li>
<li>Ends At: {{event.end_time}}</li>
<li>Participants : {{event.participants_num}}/{{event.max_participants}}</li>
<li>Poll : {{event.poll}}</li>
</ul>
</div>
{% endblock %}
Expand Down
8 changes: 7 additions & 1 deletion poll/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# from django.shortcuts import render
from django.shortcuts import render
from .models import Poll

# Create your views here.

def view_poll(request):
poll_id = request.GET["id"]
poll = Poll.manager.get(id=poll_id)
return render(request, 'event/event_info.html', {'poll': poll})

0 comments on commit 8c9d793

Please sign in to comment.