From 387b1b176f2a8520f31e53c013748b58e5218c05 Mon Sep 17 00:00:00 2001 From: ergz Date: Sat, 23 Jul 2022 17:54:12 -0700 Subject: [PATCH] adds more views for testing purposes --- polls/__pycache__/urls.cpython-310.pyc | Bin 290 -> 448 bytes polls/__pycache__/views.cpython-310.pyc | Bin 349 -> 807 bytes polls/urls.py | 5 ++++- polls/views.py | 13 ++++++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/polls/__pycache__/urls.cpython-310.pyc b/polls/__pycache__/urls.cpython-310.pyc index 35e5404b13e19919a34013568147729be8b01f9b..5614b4b2fe2acc60cf6f51710eb1edd692123852 100644 GIT binary patch delta 269 zcmZ3)bbwhqpO=@50SGu}+)1)xWMFs<;vfSKAjbiSiz6m#Ynr4orm&|nXR)Smq_Fie z19_Z49$N|*l*bL^v8V8Wc<(H)D-(mq#ewv&UdlglSK#ncq1Q8%l r-Qq4S$|*=JDM>BLD_+S^#0!$(op>Zjh!4o(Vc=onW9DN7L5@EFu-8VM delta 113 zcmX@WyogCVpO=@50SF$J+({}0(vLwLWWWmKH~?|6-b8Ipu5`vI))e+&22GBM9XiZ@ wnrxHB7!}2CahDe56eO0Eq!#5BuVg3!nOMX%IfgNahXcsuVc=onW9Ik|0J?V;6aWAK diff --git a/polls/__pycache__/views.cpython-310.pyc b/polls/__pycache__/views.cpython-310.pyc index ec96669b9b404abbf68fc017414227b922333aa2..2687fcfccd9323444be6a1e0a1ffa1e7b96af664 100644 GIT binary patch literal 807 zcmZvav2GMG5QgpDy}M0rk5JK}I0eNaaiT^DBBh~9K|~X+6gC+rXYj3$u{R+oRPYSE z!@bgqE)@k;Ix1#-Y_y56w4U*LJoEV2R|DWoNFfb?Ow|LS2|JH?<0Lt(MMOWopo$caYCcWjjLssnI^H1PFs>K6C%fv(N;Grm`g`_2s$I7k;+9YzHxa%2Zq; zmpCGG!hSc{=Kw~(DQIH!EBQ!t_}iDRQ59-so%=|oRTWgEG_F=p{4Bz+63pmqJMMOl z48%LEry=hRL5Ip%_HVdqA#qIR4h@rZH2xtiKz>bvxJvp&Pya)N+BY_Mb?UHBw^lZd zaLA9O%_%ZA@ID@iA5&~ll;_K2k_aD=bBD067jmn)#g99pa~D`5Ql=AvB#IEodGFWE zC|*x^gO$fEn)au|cD(NHY) KmGLm}FaZF75DaGk diff --git a/polls/urls.py b/polls/urls.py index 0399e3f..7271bc0 100644 --- a/polls/urls.py +++ b/polls/urls.py @@ -3,5 +3,8 @@ from django.urls import path from . import views urlpatterns = [ - path("", views.index, name = "index") + path("", views.index, name = "index"), + path("", views.detail, name="detail"), + path("/results/", views.results, name="results"), + path("/vote/", views.vote, name="vote") ] \ No newline at end of file diff --git a/polls/views.py b/polls/views.py index 06f3242..5620388 100644 --- a/polls/views.py +++ b/polls/views.py @@ -1,4 +1,15 @@ from django.http import HttpResponse def index(request): - return HttpResponse("hello from within the poll index!") \ No newline at end of file + return HttpResponse("hello from within the poll index!") + +def detail(request, question_id): + return HttpResponse("you are looking at question %s." % question_id) + +def results(request, question_id): + response = "you are looking at results for question %s" + return HttpResponse(response % question_id) + +def vote(request, question_id): + return HttpResponse("you are voting on question %s" % question_id) + \ No newline at end of file