Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding poll view to event page #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions event/templates/event/event_info.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a screenshot of the change

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})