Ejemplo n.º 1
0
    url('^topic/(?P<pk>\d+)/stick/$',
        StickTopicView.as_view(),
        name='stick_topic'),
    url('^topic/(?P<pk>\d+)/unstick/$',
        UnstickTopicView.as_view(),
        name='unstick_topic'),
    url('^topic/(?P<pk>\d+)/close/$',
        CloseTopicView.as_view(),
        name='close_topic'),
    url('^topic/(?P<pk>\d+)/open/$',
        OpenTopicView.as_view(),
        name='open_topic'),

    # Add topic/post
    url('^forum/(?P<forum_id>\d+)/topic/add/$',
        AddPostView.as_view(),
        name='add_topic'),
    url('^topic/(?P<topic_id>\d+)/post/add/$',
        AddPostView.as_view(),
        name='add_post'),

    # Post
    url('^post/(?P<pk>\d+)/$', PostView.as_view(), name='post'),
    url('^post/(?P<pk>\d+)/edit/$', EditPostView.as_view(), name='edit_post'),
    url('^post/(?P<pk>\d+)/delete/$',
        DeletePostView.as_view(),
        name='delete_post'),
    url('^post/(?P<pk>\d+)/moderate/$',
        ModeratePost.as_view(),
        name='moderate_post'),
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-

from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to, direct_to_template
from views import (AddPostView, UpdatePostView, PostIndexView, PostDetailView,
                   DeletePostView, AddTagView, UpdateTagView, TagDetailView)

entry_pattern = patterns(
    '',
    (r'^$', PostDetailView.as_view()),
    (r'^edit/$', UpdatePostView.as_view()),
    (r'^delete/$', DeletePostView.as_view()),
)

tag_pattern = patterns(
    '',
    url(r'^$', TagDetailView.as_view(), name='tag_detail'),
    (r'^edit/$', UpdateTagView.as_view()),
)

urlpatterns = patterns(
    'apps.blog.views',
    (r'^$', PostIndexView.as_view()),
    (r'^new/$', AddPostView.as_view()),
    (r'^newtag/$', AddTagView.as_view()),
    (r'^(?P<pk>\w{24})/', include(entry_pattern)),
    (r'^tags/(?P<pk>\w+)/', include(tag_pattern)),
)
Ejemplo n.º 3
0
Archivo: urls.py Proyecto: nigma/pybbm
 url("^$", IndexView.as_view(), name="index"),
 url("^category/(?P<pk>\d+)/$", CategoryView.as_view(), name="category"),
 url("^forum/(?P<pk>\d+)/$", ForumView.as_view(), name="forum"),
 # User
 url("^users/(?P<username>[^/]+)/$", UserView.as_view(), name="user"),
 url("^block_user/([^/]+)/$", "block_user", name="block_user"),
 # Profile
 url("^profile/edit/$", ProfileEditView.as_view(), name="edit_profile"),
 # Topic
 url("^topic/(?P<pk>\d+)/$", TopicView.as_view(), name="topic"),
 url("^topic/(?P<pk>\d+)/stick/$", StickTopicView.as_view(), name="stick_topic"),
 url("^topic/(?P<pk>\d+)/unstick/$", UnstickTopicView.as_view(), name="unstick_topic"),
 url("^topic/(?P<pk>\d+)/close/$", CloseTopicView.as_view(), name="close_topic"),
 url("^topic/(?P<pk>\d+)/open/$", OpenTopicView.as_view(), name="open_topic"),
 # Add topic/post
 url("^forum/(?P<forum_id>\d+)/topic/add/$", AddPostView.as_view(), name="add_topic"),
 url("^topic/(?P<topic_id>\d+)/post/add/$", AddPostView.as_view(), name="add_post"),
 # Post
 url("^post/(?P<pk>\d+)/$", PostView.as_view(), name="post"),
 url("^post/(?P<pk>\d+)/edit/$", EditPostView.as_view(), name="edit_post"),
 url("^post/(?P<pk>\d+)/delete/$", DeletePostView.as_view(), name="delete_post"),
 url("^post/(?P<pk>\d+)/moderate/$", ModeratePost.as_view(), name="moderate_post"),
 # Attachment
 # url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),
 # Subscription
 url("^subscription/topic/(\d+)/delete/$", "delete_subscription", name="delete_subscription"),
 url("^subscription/topic/(\d+)/add/$", "add_subscription", name="add_subscription"),
 # API
 url("^api/post_ajax_preview/$", "post_ajax_preview", name="post_ajax_preview"),
 # Commands
 url("^mark_all_as_read/$", "mark_all_as_read", name="mark_all_as_read"),
Ejemplo n.º 4
0
                        # User
                        url('^users/(?P<username>[^/]+)/$', UserView.as_view(), name='user'),
                        url('^block_user/([^/]+)/$', 'block_user', name='block_user'),

                        # Profile
                        # url('^profile/edit/$', ProfileEditView.as_view(), name='edit_profile'),

                        # Topic
                        url('^topic/(?P<pk>\d+)/$', TopicView.as_view(), name='topic'),
                        url('^topic/(?P<pk>\d+)/stick/$', StickTopicView.as_view(), name='stick_topic'),
                        url('^topic/(?P<pk>\d+)/unstick/$', UnstickTopicView.as_view(), name='unstick_topic'),
                        url('^topic/(?P<pk>\d+)/close/$', CloseTopicView.as_view(), name='close_topic'),
                        url('^topic/(?P<pk>\d+)/open/$', OpenTopicView.as_view(), name='open_topic'),

                        # Add topic/post
                        url('^forum/(?P<forum_id>\d+)/topic/add/$', AddPostView.as_view(), name='add_topic'),
                        url('^topic/(?P<topic_id>\d+)/post/add/$', AddPostView.as_view(), name='add_post'),

                        # Post
                        url('^post/(?P<pk>\d+)/$', PostView.as_view(), name='post'),
                        url('^post/(?P<pk>\d+)/edit/$', EditPostView.as_view(), name='edit_post'),
                        url('^post/(?P<pk>\d+)/delete/$', DeletePostView.as_view(), name='delete_post'),
                        url('^post/(?P<pk>\d+)/moderate/$', ModeratePost.as_view(), name='moderate_post'),

                        # Attachment
                        #url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),

                        # Subscription
                        url('^subscription/topic/(\d+)/delete/$',
                            'delete_subscription', name='delete_subscription'),
                        url('^subscription/topic/(\d+)/add/$',
Ejemplo n.º 5
0
    # Topic
    url(
        '^topic/(?P<id>\d+)/$',
        'redirect_topic', name='redirect_topic'
    ),
    url(
        '^topic/(?P<slug>[-\w]+)/$',
        TopicView.as_view(), name='topic'
    ),
    url('^topic/(?P<slug>[-\w]+)/stick/$', StickTopicView.as_view(), name='stick_topic'),
    url('^topic/(?P<slug>[-\w]+)/unstick/$', UnstickTopicView.as_view(), name='unstick_topic'),
    url('^topic/(?P<slug>[-\w]+)/close/$', CloseTopicView.as_view(), name='close_topic'),
    url('^topic/(?P<slug>[-\w]+)/open/$', OpenTopicView.as_view(), name='open_topic'),

    # Add topic/post
    url('^forum/(?P<forum_slug>[-\w]+)/topic/add/$', AddPostView.as_view(), name='add_topic'),
    url('^topic/(?P<topic_slug>[-\w]+)/post/add/$', AddPostView.as_view(), name='add_post'),

    # Post
    url('^post/(?P<pk>\d+)/$', PostView.as_view(), name='post'),
    url('^post/(?P<pk>\d+)/edit/$', EditPostView.as_view(), name='edit_post'),
    url('^post/(?P<pk>\d+)/delete/$', DeletePostView.as_view(), name='delete_post'),
    url('^post/(?P<pk>\d+)/moderate/$', ModeratePost.as_view(), name='moderate_post'),

    # Attachment
    #url('^attachment/(\w+)/$', 'show_attachment', name='pybb_attachment'),

    # Subscription
    url('^subscription/topic/(?P<slug>[-\w]+)/delete/$',
        'delete_subscription', name='delete_subscription'),
    url('^subscription/topic/(?P<slug>[-\w]+)/add/$',
Ejemplo n.º 6
0
# -*- coding: utf-8 -*-

from django.conf.urls.defaults import *
from django.views.generic.simple import redirect_to, direct_to_template
from views import (AddPostView, UpdatePostView, PostIndexView,
                   PostDetailView, DeletePostView, AddTagView, 
                   UpdateTagView, TagDetailView)

entry_pattern = patterns('',
    (r'^$', PostDetailView.as_view()),
    (r'^edit/$', UpdatePostView.as_view()),
    (r'^delete/$', DeletePostView.as_view() ),
)

tag_pattern = patterns('',
    url(r'^$', TagDetailView.as_view(), name='tag_detail'),
    (r'^edit/$', UpdateTagView.as_view()),
)

urlpatterns = patterns('apps.blog.views',
    (r'^$', PostIndexView.as_view()),
    (r'^new/$', AddPostView.as_view()),
    (r'^newtag/$', AddTagView.as_view()),
    (r'^(?P<pk>\w{24})/', include(entry_pattern)),
    (r'^tags/(?P<pk>\w+)/', include(tag_pattern)),
)