Esempio n. 1
0
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from notes.views import (NoteCreateView, NoteDeleteView,
NoteDetailView, NoteUpdateView)


# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = [
    url(r'^create/$', login_required(NoteCreateView.as_view()),
        name='create_note'),
    url(r'^(?P<pk>\d+)/$', login_required(NoteDetailView.as_view()),
        name='view_note'),
    url(r'^(?P<pk>\d+)/edit/$', login_required(NoteUpdateView.as_view()),
        name='edit_note'),
    url(r'^(?P<pk>\d+)/delete/$', login_required(NoteDeleteView.as_view()),
        name='delete_note')
]
Esempio n. 2
0
from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from notes.views import (NoteCreateView, NoteDeleteView, NoteDetailView,
                         NoteUpdateView)

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = [
    url(r'^create/$',
        login_required(NoteCreateView.as_view()),
        name='create_note'),
    url(r'^(?P<pk>\d+)/$',
        login_required(NoteDetailView.as_view()),
        name='view_note'),
    url(r'^(?P<pk>\d+)/edit/$',
        login_required(NoteUpdateView.as_view()),
        name='edit_note'),
    url(r'^(?P<pk>\d+)/delete/$',
        login_required(NoteDeleteView.as_view()),
        name='delete_note'),
]
Esempio n. 3
0
from django.urls import path
from notes.views import NotesListView, NoteCreateView, NoteUpdateView, NoteDeleteView

urlpatterns = [
    path('list/', NotesListView.as_view(), name='list_notes'),
    path('add/', NoteCreateView.as_view(), name='note_add'),
    path('<pk>/update/', NoteUpdateView.as_view(), name='note_update'),
    path('<pk>/delete/', NoteDeleteView.as_view(), name='note_delete'),
]
Esempio n. 4
0
        paginate_by=1,
        queryset=MyUser.objects.all().order_by('id'),
        context_object_name='users_list',
        template_name='notes/users/index.html'
    ), name='users'),
    url(r"^users/(?P<slug>\w+)/$", DetailView.as_view(
        context_object_name='user',
        model=MyUser,
        template_name='notes/users/show.html',
        slug_field='username'
    ), name='user_show'),
    url(r"^users/(?P<username>\w+)/notes/$", NotesList.as_view(), name='user_notes'),
    url(r"^users/(?P<username>\w+)/notes/add/$", NoteCreateView.as_view(), name='user_notes_add'),
    url(r"^users/(?P<username>\w+)/notes/(?P<pk>[0-9]+)/$", DetailView.as_view(
        context_object_name='note',
        model=Note,
        template_name='notes/notes/show.html'
    ), name='user_notes_show'),
    url(r"^users/(?P<slug>\w+)/notes/(?P<pk>[0-9]+)/edit/$",
        NoteEditView.as_view(),
        name='user_notes_edit'),
    url(r"^users/(?P<slug>\w+)/notes/(?P<pk>[0-9]+)/delete/$",
        NoteDeleteView.as_view(),
        name='user_notes_delete'),
    url(r"^users/(?P<username>\w+)/notes/(?P<note_id>[0-9]+)/labels/add/$",
        CreateLabelList.as_view(),
        name='user_notes_labels_add'),
    url(r"^users/(?P<username>\w+)/notes/(?P<note_id>[0-9]+)/labels/(?P<pk>[0-9]+)/delete/$",
        LabelDeleteView.as_view(),
        name='user_notes_labels_delete'),
]
Esempio n. 5
0
    url(r'^ggv/(?P<crs_slug>[-\w]+)/questions/(?P<asset>.+)/$', QuestionAssetHandlerView.as_view(), name='question_asset'),

    url(r'^ggv/support-media/external-media/(?P<pk>\d+)/$', ExternalMediaView.as_view(), name='external_media_view'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/support-media/external-media/(?P<pk>\d+)/$', ExternalMediaCourseView.as_view(), name='external_media_view_crs'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/support-media/external-media/add/$', ExternalMediaCreateView.as_view(), name='external_media_add'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/support-media/external-media/edit/(?P<pk>\d+)/$', ExternalMediaUpdateView.as_view(), name='external_media_update'),

    url(r'^ggv/grade/(?P<pk>\d+)/$', QuestionResponseGradeView.as_view(), name='question_response_grade'),


# GGV components
    url(r'^ggv/(?P<crs_slug>[-\w]+)/note/(?P<pk>\d+)/$', NoteView.as_view(), name='view_note'),
    url(r'^ggv/note/add/$', NoteCreateView.as_view(), name='create_note'),
    # url(r'^ggv/note/update/(?P<pk>\d+)/$', NoteUpdateView.as_view(), name='update_note'),
    url(r'^ggv/note/delete/(?P<pk>\d+)/$', NoteDeleteView.as_view(), name='delete_note'),

    url(r'^ggv/bookmark/add/$', BookmarkAjaxCreateView.as_view(), name='create_bookmark'),
    url(r'^ggv/bookmark/update/(?P<pk>\d+)/$', BookmarkAjaxUpdateView.as_view(), name='update_bookmark'),
    url(r'^ggv/bookmark/delete/(?P<pk>\d+)/$', BookmarkAjaxDeleteView.as_view(), name='delete_bookmark'),

# Users
    url(r'^ggv/(?P<crs_slug>[-\w]+)/user/add/$', CreateGgvUserView.as_view(), name='create_user'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/user/(?P<pk>[-\d]+)/$', GgvUserView.as_view(), name='view_user'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/user/edit-account/(?P<pk>[-\d]+)/$', UpdateGgvUserAccountView.as_view(), name='edit_user_account'),
    url(r'^ggv/(?P<crs_slug>[-\w]+)/user/edit/(?P<pk>[-\d]+)/$', UpdateGgvUserView.as_view(), name='edit_user'),

    url(r'^ggv/user/deactivate/(?P<pk>[-\d]+)/$', GgvUserActivationView.as_view(), name='update_user_activation'),

    url(r'^ggv/users/deactivate/$', GgvUsersDeactivationView.as_view(), name='deactivate_users'),
    url(r'^ggv/users/activate/$', GgvUsersActivationView.as_view(), name='activate_users'),
Esempio n. 6
0
    # url(r'^notejam/', include('notejam.foo.urls')),

    # pad views
    url(r'^pads/create/$', login_required(PadCreateView.as_view()),
        name='create_pad'),
    url(r'^pads/(?P<pk>\d+)/$', login_required(PadNotesListView.as_view()),
        name='view_pad_notes'),
    url(r'^pads/(?P<pk>\d+)/edit/$', login_required(PadUpdateView.as_view()),
        name='edit_pad'),
    url(r'^pads/(?P<pk>\d+)/delete/$', login_required(PadDeleteView.as_view()),
        name='delete_pad'),

    # note views
    url(r'^notes/create/$', login_required(NoteCreateView.as_view()),
        name='create_note'),
    url(r'^notes/(?P<pk>\d+)/$', login_required(NoteDetailView.as_view()),
        name='view_note'),
    url(r'^notes/(?P<pk>\d+)/edit/$', login_required(NoteUpdateView.as_view()),
        name='edit_note'),
    url(r'^notes/(?P<pk>\d+)/delete/$', login_required(NoteDeleteView.as_view()),
        name='delete_note'),

    url(r'^$', login_required(NoteListView.as_view()), name='home'),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)
Esempio n. 7
0
from django.urls import path
from notes.views import NoteListView
from notes.views import NoteDetailView
from notes.views import NoteCreateView
from notes.views import NoteUpdateView
from notes.views import NoteDeleteView
from notes.views import UserNoteListView
from notes import views

urlpatterns = [
    path('', NoteListView.as_view(), name='notes-home'),
    path('about/', views.about, name='notes-about'),
    path('user/<str:username>', UserNoteListView.as_view(), name='user-notes'),
    path('note/<int:pk>/', NoteDetailView.as_view(), name='note-detail'),
    path('note/new/', NoteCreateView.as_view(), name='note-create'),
    path('note/<int:pk>/update/', NoteUpdateView.as_view(),
         name='note-update'),
    path('note/<int:pk>/delete/', NoteDeleteView.as_view(), name='note-delete')
]