示例#1
0
文件: renderers.py 项目: CTPUG/wafer
    def get_paths(self):
        paths = ["/talks/"]

        items = Talk.objects.filter(status=ACCEPTED)
        for item in items:
            paths.append(item.get_absolute_url())
        view = UsersTalks()
        view.request = None
        queryset = view.get_queryset()
        paginator = view.get_paginator(queryset, view.get_paginate_by(queryset))
        for page in paginator.page_range:
            paths.append(reverse("wafer_users_talks_page", kwargs={"page": page}))
        paths.append(reverse("wafer_talks_speakers"))
        return paths
示例#2
0
    def get_paths(self):
        paths = [
            "/talks/",
        ]

        items = Talk.objects.filter(status=ACCEPTED)
        for item in items:
            paths.append(item.get_absolute_url())
        view = UsersTalks()
        view.request = None
        queryset = view.get_queryset()
        paginator = view.get_paginator(queryset,
                                       view.get_paginate_by(queryset))
        for page in paginator.page_range:
            paths.append(
                reverse('wafer_users_talks_page', kwargs={'page': page}))
        return paths
示例#3
0
from django.conf.urls import patterns, url

from wafer.talks.views import (TalkCreate, TalkDelete, TalkUpdate, TalkView,
                               UsersTalks)

urlpatterns = patterns(
    '',
    url(r'^$', UsersTalks.as_view(), name='wafer_users_talks'),
    url(r'^page/(?P<page>\d+)$',
        UsersTalks.as_view(),
        name='wafer_users_talks_page'),
    url(r'^new/$', TalkCreate.as_view(), name='wafer_talk_submit'),
    url(r'^(?P<pk>\d+)/$', TalkView.as_view(), name='wafer_talk'),
    url(r'^(?P<pk>\d+)/edit/$', TalkUpdate.as_view(), name='wafer_talk_edit'),
    url(r'^(?P<pk>\d+)/delete/$',
        TalkDelete.as_view(),
        name='wafer_talk_delete'),
)
示例#4
0
from wafer.talks.views import (
    Speakers, TalkCreate, TalkReview, TalkTypesView, TalkUpdate,
    TalkUrlsViewSet, TalkView, TalkWithdraw, TalksViewSet, TracksView,
    UsersTalks)

router = routers.ExtendedSimpleRouter()

# FIXME: Change base_name when we drop python 2 and move to drf-extensions 0.5
talks_router = router.register(r'talks', TalksViewSet)
talks_router.register(
    r'urls', TalkUrlsViewSet, base_name='talks-urls',
    parents_query_lookups=['talk'])

urlpatterns = [
    url(r'^$', UsersTalks.as_view(), name='wafer_users_talks'),
    url(r'^page/(?P<page>\d+)/$', UsersTalks.as_view(),
        name='wafer_users_talks_page'),
    url(r'^new/$', TalkCreate.as_view(), name='wafer_talk_submit'),
    url(r'^(?P<pk>\d+)(?:-(?P<slug>[\w-]*))?/$', TalkView.as_view(),
        name='wafer_talk'),
    url(r'^(?P<pk>\d+)/edit/$', TalkUpdate.as_view(),
        name='wafer_talk_edit'),
    url(r'^(?P<pk>\d+)/review/$', TalkReview.as_view(),
        name='wafer_talk_review'),
    url(r'^(?P<pk>\d+)/withdraw/$', TalkWithdraw.as_view(),
        name='wafer_talk_withdraw'),
    url(r'^speakers/$', Speakers.as_view(), name='wafer_talks_speakers'),
    url(r'^tracks/', TracksView.as_view(), name='wafer_talk_tracks'),
    url(r'^types/', TalkTypesView.as_view(), name='wafer_talk_types'),
    url(r'^api/', include(router.urls)),
示例#5
0
文件: urls.py 项目: lelutin/wafer
from django.conf.urls import url, include
from rest_framework_extensions import routers

from wafer.talks.views import (
    Speakers, TalkCreate, TalkDelete, TalkUpdate, TalkView, UsersTalks,
    TalksViewSet, TalkUrlsViewSet)

router = routers.ExtendedSimpleRouter()

talks_router = router.register(r'talks', TalksViewSet)
talks_router.register(
    r'urls', TalkUrlsViewSet, base_name='talks-urls',
    parents_query_lookups=['talk'])

urlpatterns = [
    url(r'^$', UsersTalks.as_view(), name='wafer_users_talks'),
    url(r'^page/(?P<page>\d+)/$', UsersTalks.as_view(),
        name='wafer_users_talks_page'),
    url(r'^new/$', TalkCreate.as_view(), name='wafer_talk_submit'),
    url(r'^(?P<pk>\d+)/$', TalkView.as_view(), name='wafer_talk'),
    url(r'^(?P<pk>\d+)/edit/$', TalkUpdate.as_view(),
        name='wafer_talk_edit'),
    url(r'^(?P<pk>\d+)/delete/$', TalkDelete.as_view(),
        name='wafer_talk_delete'),
    url(r'^speakers/$', Speakers.as_view(), name='wafer_talks_speakers'),
    url(r'^api/', include(router.urls)),
]
示例#6
0
文件: urls.py 项目: timkeller/wafer
from django.conf.urls.defaults import patterns, url

from wafer.talks.views import (
    TalkCreate, TalkDelete, TalkUpdate, TalkView, UsersTalks)

urlpatterns = patterns(
    '',
    url(r'^$', UsersTalks.as_view(), name='wafer_users_talks'),
    url(r'^new/$', TalkCreate.as_view(), name='wafer_talk_submit'),
    url(r'^(?P<pk>\d+)/$', TalkView.as_view(), name='wafer_talk'),
    url(r'^(?P<pk>\d+)/edit/$', TalkUpdate.as_view(),
        name='wafer_talk_edit'),
    url(r'^(?P<pk>\d+)/delete/$', TalkDelete.as_view(),
        name='wafer_talk_delete'),
)