Пример #1
0
 def dispatch(self, request, *args, **kwargs):
     return ChapterDelete.dispatch(self, request, *args, **kwargs)
Пример #2
0
 def dispatch(self, request, *args, **kwargs):
     return ChapterDelete.dispatch(self, request, *args, **kwargs)
Пример #3
0
    url(r'^story/(?P<pk>\d+)/vote/minus/$', 'story_vote', {'direction': False}, name='story_vote_minus'),
    # Загрузка рассказа
    url(r'^story/(?P<story_id>\d+)/download/(?P<filename>\w+)\.(?P<extension>[\w\.]+)$', 'story_download'),
)
# Работа с главами
urlpatterns += patterns('ponyFiction.views.chapter',
    # Просмотр одной
    url(r'^story/(?P<story_id>\d+)/chapter/(?P<chapter_order>\d+)/$', 'chapter_view', name='chapter_view_single'),
    # Просмотр всех глав
    url(r'^shtory/(?P<story_id>\d+)/chapter/all/$', 'chapter_view', name='chapter_view_all'),
    # Добавление
    url(r'^story/(?P<story_id>\d+)/chapter/add/$', ChapterAdd.as_view(), name='chapter_add'),
    # Правка
    url(r'^chapter/(?P<pk>\d+)/edit/$', ChapterEdit.as_view(), name='chapter_edit'),
    # Удаление
    url(r'^chapter/(?P<pk>\d+)/delete/$', ChapterDelete.as_view(), name='chapter_delete'),
)
# Другое
urlpatterns += patterns('',
    url(r'^not_found/$', TemplateView.as_view(template_name='404.html')),
    url(r'^bad_gateway/$', TemplateView.as_view(template_name='502.html')),
    url(r'^forbidden/$', TemplateView.as_view(template_name='403.html')),
    url(r'^internal_server_error/$', TemplateView.as_view(template_name='500.html')),
    url(r'^terms/$', TemplateView.as_view(template_name='terms.html', get_context_data=lambda: {'page_title': 'Правила'}), name='terms'),
    url(r'^help/$', TemplateView.as_view(template_name='help.html', get_context_data=lambda: {'page_title': 'Справка'}), name='help'),
)
if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
    )