示例#1
0
from django.conf.urls import url
from tasks.views import TaskListView, TaskDetailView, TaskCreateView, TaskDelete, TaskUpdateView

from . import views

# to difference between apps, for polls application use this app name for all the urls
app_name = 'tasks'
urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^create', views.create_task, name='create'),
    url(r'^delete', views.delete_task, name='delete'),
    url(r'^assign', views.assign, name='assign'),
    url(r'^my', views.my_tasks, name='my_tasks'),
    url(r'^login', views.login, name='login'),
    url(r'^logout', views.logout, name='logout'),

    # class-based-views
    url(r'^generic/$', TaskListView.as_view(), name='task_list'),
    url(r'^generic/detail/(?P<pk>[0-9]+)/$', TaskDetailView.as_view(), name='task_detail'),
    url(r'^generic/create/', TaskCreateView.as_view(), name='task_create'),
    url(r'^generic/delete/(?P<pk>[0-9]+)/$', TaskDelete.as_view(), name='task_delete'),
    url(r'^generic/update/(?P<pk>[0-9]+)/$', TaskUpdateView.as_view(), name='task_update'),
    # ajax routes
    url(r'^ajax/delete_task', views.delete_task, name='delete_task'),
    url(r'^ajax/change_priority_task', views.change_priority_task, name='change_priority_task'),
]
示例#2
0
from django.conf.urls import url

from tasks.views import (
    TaskListView, TaskDetailView, TaskCreateView, TaskUpdateView,
    ListDetailView, ListListView, ListCreateView, ListUpdateView,
    ListWithTasksCreateView, ListWithTasksUpdateView
)

app_name = 'tasks'

urlpatterns = [
    url(r'^$', TaskListView.as_view(), name='task_list'),
    url(r'^(?P<pk>\d+)/$', TaskDetailView.as_view(), name='task_detail'),
    url(r'^create/$', TaskCreateView.as_view(), name='task_create'),
    url(r'^(?P<pk>\d+)/edit/$', TaskUpdateView.as_view(), name='task_edit'),

    url(r'^list/(?P<pk>\d+)/$', ListDetailView.as_view(), name='list_detail'),
    url(r'^list/create/$', ListCreateView.as_view(), name='list_create'),
    url(
        r'^list/(?P<pk>\d+)/edit/$', ListUpdateView.as_view(),
        name='list_edit'
    ),
    url(r'^lists/$', ListListView.as_view(), name='list_list'),
    url(
        r'^list/with-tasks/$', ListWithTasksCreateView.as_view(),
        name='list_tasks_create'
    ),
    url(
        r'^list/with-tasks/(?P<pk>\d+)/edit/$',
        ListWithTasksUpdateView.as_view(),
        name='list_tasks_edit'
示例#3
0
from django.conf.urls import url, include

from tasks.views import TaskCreateView, TaskUpdateView, TaskDeleteView, \
    TaskDetailView, TaskListView, TaskStatusUpdateView, CompletedTaskListView

from nucleus.decorators import is_admin

urlpatterns = [
        url(r'^(?P<pk>\d+)/', include([
            url(r'^edit/$', is_admin(TaskUpdateView.as_view()),
                name='edit_task'),
            url(r'^update_status/$',
                is_admin(TaskStatusUpdateView.as_view()),
                name='update_task_status'),
            url(r'^delete/$', is_admin(TaskDeleteView.as_view()),
                name='delete_task'),
            url(r'^$', is_admin(TaskDetailView.as_view()),
                name='view_task'),
        ])),
        url(r'^add/', is_admin(TaskCreateView.as_view()),
            name='add_task'),
        url(r'^completed/', is_admin(CompletedTaskListView.as_view()),
            name='browse_completed_tasks'),
        url(r'^$', is_admin(TaskListView.as_view())
            , name='browse_tasks'),
]
示例#4
0
from django.urls import path

from tasks.views import \
    (TaskDetailView,
     TaskCreateView,
     TaskListView,
     TaskAcceptView,
     TaskDoneView,
     ExecutorAcceptedTasksView)

urlpatterns = [
    path('task/', TaskCreateView.as_view(), name='task'),
    path('tasks/', TaskListView.as_view(), name='tasks'),
    path('tasks/<int:pk>', TaskDetailView.as_view(), name='tasks_detail'),
    path('tasks/<int:pk>/accept',
         TaskAcceptView.as_view(),
         name='tasks_accept'),
    path('tasks/<int:pk>/done', TaskDoneView.as_view(), name='tasks_done'),
    path('tasks/accepted',
         ExecutorAcceptedTasksView.as_view(),
         name='executor_tasks'),
]
示例#5
0
from django.urls import path

from tasks.views import TaskListView, TaskDetailView, TaskCreateView

urlpatterns = [
    path('', TaskListView.as_view()),
    path('create', TaskCreateView.as_view()),
    path('<int:task_id>/delete', TaskDetailView.as_view()),
    path('<int:task_id>/update', TaskDetailView.as_view()),
]
示例#6
0
from django.conf.urls import url

from tasks.views import TasksView, TaskDetailView, TaskCreateView, TaskDestroyView

urlpatterns = [
    url(r'^$', TasksView.as_view(), name="list_tasks"),
    url(r'create/$', TaskCreateView.as_view(), name="create_task"),
    url(r'delete/$', TaskDestroyView.as_view(), name='delete_tasks'),
    url(r'detail/(?P<pk>\d+)/$', TaskDetailView.as_view(), name="detail_task"),
]
示例#7
0
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path

from django.conf import settings
from django.conf.urls.static import static

from tasks.views import (TaskListView, TaskDetailsView, TaskUpdateView,
                         TaskDeleteView, TaskCreateView)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('tasklist/', TaskListView.as_view(), name='task-list'),
    path('tasklist/<int:taskl_id>/',
         TaskDetailsView.as_view(),
         name='task-detail'),
    path('tasklist/<int:taskl_id>/update/',
         TaskUpdateView.as_view(),
         name='task-update'),
    path('tasklist/<int:taskl_id>/delete/',
         TaskDeleteView.as_view(),
         name='task-delete'),
    path('tasklist/create/', TaskCreateView.as_view(), name='task-create'),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例#8
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from tasks.views import (TaskCreateView, TaskDeleteView, TaskDoneView,
                         TaskListView, TaskResetView)


urlpatterns = patterns('',
    url(r'^$', login_required(TaskListView.as_view()), name='tasks'),
    url(r'^add/$', login_required(TaskCreateView.as_view()), name='task-create'),
    url(r'^(?P<uuid>[\w\d_.-]+)/reset/$', login_required(TaskResetView.as_view()), name='task-reset'),
    url(r'^(?P<uuid>[\w\d_.-]+)/done/$', login_required(TaskDoneView.as_view()), name='task-done'),
    url(r'^(?P<uuid>[\w\d_.-]+)/delete/$', login_required(TaskDeleteView.as_view()), name='task-delete'),
)
示例#9
0
    TaskStatusDeleteView,
    TagListView,
    TagCreateView,
    TagDeleteView,
)

app_name = 'tasks'
urlpatterns = [
    path(
        '',
        TaskListView.as_view(),
        name='task_list',
    ),
    path(
        'new/',
        TaskCreateView.as_view(),
        name='task_add',
    ),
    path(
        '<int:pk>',
        TaskDetailView.as_view(),
        name='task_detail',
    ),
    path(
        '<int:pk>/edit',
        TaskUpdateView.as_view(),
        name='task_edit',
    ),
    path(
        '<int:pk>/delete',
        TaskDeleteView.as_view(),
示例#10
0
    # Argument URLS
    url(r'^arguments$', ArgumentListView.as_view(), name='argument-list'),
    url(r'^argument/add/$',
        ArgumentCreateView.as_view(),
        name='argument-create'),
    url(r'^argument/(?P<pk>[\w\d]+)/$',
        ArgumentDetailView.as_view(),
        name='argument-detail'),
    url(r'^argument/(?P<pk>[\w\d]+)/edit/$',
        ArgumentUpdateView.as_view(),
        name='argument-update'),
    url(r'^argument/(?P<pk>[\w\d]+)/delete/$',
        ArgumentDeleteView.as_view(),
        name='argument-delete'),
    # Task URLS
    url(r'^tasks$', TaskListView.as_view(), name='task-list'),
    url(r'^task/(?P<id>\d+)/run/$', runTask, name='runTask'),
    # url(r'^task/(?P<pk>[\w\d]+)/run/$',
    #                           runTask, name='runTask'),
    url(r'^task/add/$', TaskCreateView.as_view(), name='task-create'),
    url(r'^task/(?P<pk>[\w\d]+)/$',
        TaskDetailView.as_view(),
        name='task-detail'),
    url(r'^task/(?P<pk>[\w\d]+)/edit/$',
        TaskUpdateView.as_view(),
        name='task-update'),
    url(r'^task/(?P<pk>[\w\d]+)/delete/$',
        TaskDeleteView.as_view(),
        name='task-delete'),
)