Ejemplo n.º 1
0
from django.urls import path, re_path
from django.views.i18n import JavaScriptCatalog

from comment.views import (CreateComment, UpdateComment, DeleteComment,
                           SetReaction, SetFlag, ChangeFlagState,
                           ConfirmComment)

app_name = 'comment'

urlpatterns = [
    path('create/', CreateComment.as_view(), name='create'),
    path('edit/<int:pk>/', UpdateComment.as_view(), name='edit'),
    path('delete/<int:pk>/', DeleteComment.as_view(), name='delete'),
    path('<int:pk>/react/<str:reaction>/', SetReaction.as_view(),
         name='react'),
    path('<int:pk>/flag/', SetFlag.as_view(), name='flag'),
    path('<int:pk>/flag/state/change/',
         ChangeFlagState.as_view(),
         name='flag-change-state'),
    re_path(r'^confirm/(?P<key>[^/]+)/$',
            ConfirmComment.as_view(),
            name='confirm-comment'),
    # javascript translations
    path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
]
Ejemplo n.º 2
0
from django.urls import path

from comment.views import CreateNewComment, GetCommentsByUser, DeleteComment, ToggleLikeComment, GetCommentsByReview

urlpatterns = [
    path('new/<int:pk>/', CreateNewComment.as_view()),
    path('<int:user_id>/', GetCommentsByUser.as_view()),
    path('delete/<int:comment_id>/', DeleteComment.as_view()),
    path('like/<int:pk>/', ToggleLikeComment.as_view()),
    path('review/<review_id>/', GetCommentsByReview.as_view())
]