99
by Holger Rapp
First draft version of wlpoll, a poll application |
1 |
#!/usr/bin/env python -tt
|
2 |
# encoding: utf-8
|
|
3 |
#
|
|
4 |
||
532.1.1
by franku
converted to python 3.6 using 2to3 script |
5 |
from .models import Poll |
404.2.2
by franku
test install |
6 |
from django.conf.urls import * |
404.2.6
by franku
updated settings.py pip_requirements; first try on polls,news and loginbox; still not woriking at all; so many differences :-D |
7 |
from . import views |
8 |
from django.views.generic.dates import ArchiveIndexView |
|
99
by Holger Rapp
First draft version of wlpoll, a poll application |
9 |
|
438.1.6
by franku
run the script |
10 |
# delete this
|
100
by Holger Rapp
Finished simple voting application |
11 |
info_dict = { |
12 |
'queryset': Poll.objects.all() |
|
13 |
}
|
|
14 |
||
404.2.29
by franku
urlpatterns are lists; patterns are deprecated |
15 |
urlpatterns = [ |
438.1.6
by franku
run the script |
16 |
url(r'^$', ArchiveIndexView.as_view(model=Poll, date_field='pub_date', |
17 |
template_name='wlpoll/poll_list.html'), name='wlpoll_archive'), |
|
18 |
url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), |
|
19 |
name='wlpoll_detail'), |
|
20 |
url(r'(?P<object_id>\d+)/vote/$', views.vote, name='wlpoll_vote'), |
|
404.2.29
by franku
urlpatterns are lists; patterns are deprecated |
21 |
]
|