from django.conf.urls import url from django.contrib.auth.decorators import login_required from polls.views import PollDetailView, PollListView, PollVoteView urlpatterns = [ url(r'^$', PollListView.as_view(), name='list'), url(r'^(?P<pk>\d+)/$', PollDetailView.as_view(), name='detail'), url(r'^(?P<pk>\d+)/vote/$', login_required(PollVoteView.as_view()), name='vote'), ]
# BLOG url(r'^(?P<location_slug>[\w-]+)/news/create', blog_views.NewsCreateView.as_view(), name='news_create'), url(r'^(?P<location_slug>[\w-]+)/news/(?P<slug>[\w-]+)/update/', blog_views.NewsUpdateView.as_view(), name='news_update'), url(r'^(?P<location_slug>[\w-]+)/news/(?P<slug>[\w-]+)', blog_views.NewsDetailView.as_view(), name='news_detail'), url(r'^(?P<location_slug>[\w-]+)/news/', blog_views.NewsListView.as_view(), name='news'), # FORUM (discussions) url(r'^(?P<slug>[\w-]+)/discussion/create/', LocationDiscussionCreate.as_view(), name='new_topic'), url(r'^(?P<place_slug>[\w-]+)/discussion/(?P<slug>[\w-]+)/', DiscussionDetailView.as_view(), name='topic'), url(r'^(?P<location_slug>[\w-]+)/discussion/', DiscussionListView.as_view(), name='discussions'), # POLLS url(r'^(?P<slug>[\w-]+)/polls/create/', LocationPollCreate.as_view(), name='new_poll'), url(r'^(?P<place_slug>[\w-]+)/polls/(?P<slug>[\w-]+)/results/', PollResults.as_view(), name='results'), url(r'^(?P<place_slug>[\w-]+)/polls/(?P<slug>[\w-]+)', PollDetails.as_view(), name='poll'), url(r'^(?P<location_slug>[\w-]+)/polls/', PollListView.as_view(), name='polls'), # Location followers list url(r'^(?P<slug>[\w-]+)/followers/', LocationFollowersList.as_view(), name='followers'), # Delete content from location collections url(r'^remove_content/(?P<content_type>\d+)/(?P<object_pk>\d+)/', LocationContentDelete.as_view(), name='remove_content'), # Location media gallery url(r'^(?P<slug>[\w-]+)/gallery/create/', LocationGalleryCreateView.as_view(), name='upload'), url(r'^(?P<slug>[\w-]+)/gallery/update/(?P<pk>\d+)/', LocationGalleryUpdateView.as_view(), name='gallery_update'), url(r'^(?P<slug>[\w-]+)/gallery/delete/(?P<pk>\d+)/', location_gallery_delete, name='remove_picture'), url(r'^(?P<slug>[\w-]+)/gallery/(?P<pk>\d+)/', PlacePictureView.as_view(), name='picture'), url(r'^(?P<location_slug>[\w-]+)/gallery/', LocationGalleryView.as_view(), name='gallery'), # PROJECTS in locations url(r'^(?P<location_slug>[\w-]+)/projects/create/(?P<idea_pk>\d+)/', project_views.CreateProjectView.as_view(), name='project_create_for_idea'), url(r'^(?P<location_slug>[\w-]+)/projects/create/', project_views.CreateProjectView.as_view(), name='project_create'),
from django.conf.urls import patterns, url from django.utils import timezone from polls.models import Poll from polls.views import PollDetailView, PollListView urlpatterns = patterns('', url(r'^$', PollListView.as_view(), name='index'), url(r'^(?P<pk>\d+)/$', PollDetailView.as_view(), name='detail'), url(r'^(?P<pk>\d+)/results/$', PollDetailView.as_view( template_name='polls/results.html'), name='results'), url(r'^(?P<poll_id>\d+)/vote/$', 'polls.views.vote', name='vote'), )
def get_urls(self, page=None, language=None, **kwargs): return [ url(r'^$', PollListView.as_view()), url(r'^(?P<slug>[\w-]+)/?$', PollDetailView.as_view()), ]
url(r'^(?P<location_slug>[\w-]+)/discussion/', DiscussionListView.as_view(), name='discussions'), # POLLS url(r'^(?P<slug>[\w-]+)/polls/create/', LocationPollCreate.as_view(), name='new_poll'), url(r'^(?P<place_slug>[\w-]+)/polls/(?P<slug>[\w-]+)/results/', PollResults.as_view(), name='results'), url(r'^(?P<place_slug>[\w-]+)/polls/(?P<slug>[\w-]+)', PollDetails.as_view(), name='poll'), url(r'^(?P<location_slug>[\w-]+)/polls/', PollListView.as_view(), name='polls'), # Location followers list url(r'^(?P<slug>[\w-]+)/followers/', LocationFollowersList.as_view(), name='followers'), # Delete content from location collections url(r'^remove_content/(?P<content_type>\d+)/(?P<object_pk>\d+)/', LocationContentDelete.as_view(), name='remove_content'), # Location media gallery url(r'^(?P<slug>[\w-]+)/gallery/create/', LocationGalleryCreateView.as_view(), name='upload'), url(r'^(?P<slug>[\w-]+)/gallery/update/(?P<pk>\d+)/',
from django.conf.urls import url from polls.views import PollListView urlpatterns = [ url(r'^polls/$', PollListView.as_view(), name='poll-list'), ]
from django.conf.urls import patterns, url from django.contrib.auth.decorators import login_required from polls.views import PollDetailView, PollListView, PollVoteView urlpatterns = patterns( "", url(r"^$", PollListView.as_view(), name="list"), url(r"^(?P<pk>\d+)/$", PollDetailView.as_view(), name="detail"), url(r"^(?P<pk>\d+)/vote/$", login_required(PollVoteView.as_view()), name="vote"), )