Example #1
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'),
]
Example #2
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'),
]
Example #3
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()),
]
Example #4
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'
Example #5
0
from django.urls import path

from tasks.views import TaskListView

urlpatterns = [
    path('', TaskListView.as_view(), name='task'),
]
Example #6
0
from django.urls import path
from tasks.views import TaskListView

helper_patterns = [
    path('tarefas/', TaskListView.as_view(), name='tarefas'),
]

urlpatterns = helper_patterns
Example #7
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    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.urls import path
from tasks.views import TaskListView, TaskDetailView, TaskUpdateView, change_status_view
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('', TaskListView.as_view(), name="server_tasks"),
    path('<int:id>/', TaskDetailView.as_view(), name="task_detail"),
    path('<int:id>/edit', TaskUpdateView.as_view(), name="task_update"),
    path('<int:id>/change_status',
         change_status_view,
         name="task_change_status"),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.conf.urls import url, include
from tasks.models import Task
from tasks.serializers import TaskSerializer
from tasks.views import TaskListView

urlpatterns = [
    url(r'^api/tasks/',
        TaskListView.as_view(queryset=Task.objects.all(),
                             serializer_class=TaskSerializer),
        name='user-list'),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    url(r'^admin/', admin.site.urls),
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Example #9
0
from django.urls import path

from project.views import ProjectListView, ProjectDetailView
from project.views import ReleaseListView, ReleaseDetailView
from project.views import SprintListView, SprintDetailView
from project.views import SprintProjectListView
from tasks.views import TaskListView, TaskDetailView
from tasks.views import TaskListFilterView, TaskDetailFilterView

urlpatterns = [
    path('', ProjectListView.as_view()),
    path('<int:pk>/', ProjectDetailView.as_view()),
    path('<int:project_pk>/releases/', ReleaseListView.as_view()),
    path('<int:project_pk>/releases/<int:pk>/', ReleaseDetailView.as_view()),
    path('<int:project_pk>/releases/<int:release_pk>/sprints/',
         SprintListView.as_view()),
    path('<int:project_pk>/releases/<int:release_pk>/sprints/<int:pk>/',
         SprintDetailView.as_view()),
    path('<int:project_pk>/sprints/', SprintProjectListView.as_view()),
    path('<int:project_pk>/releases/<int:release_pk>/sprints/<int:pk>/tasks/',
         TaskListView.as_view()),
    path(
        '<int:project_pk>/releases/<int:release_pk>/sprints/<int:sprint_pk>/tasks/<int:pk>/',  # noqa E501
        TaskDetailView.as_view()),
    path(
        # '<int:pk>/tasks/?release_id=<release_id>&sprint_id=<sprint_id>/',
        '<int:pk>/tasks/',
        TaskListFilterView.as_view()),
    path('<int:project_pk>/tasks/<int:pk>/', TaskDetailFilterView.as_view()),
]
Example #10
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'),
]
Example #11
0
from django.urls import path

from tasks.views import TaskView, TaskListView

app_name = 'tasks'
urlpatterns = [
    path('<uuid:task_id>/', TaskView.as_view(), name='view'),
    path('', TaskListView.as_view(), name='list'),
]
Example #12
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)
Example #13
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'),
)
Example #14
0
from django.conf.urls import include, url
from tasks.views import (TaskListView, TaskDetailView)

urlpatterns = [
    url(r'^tasks/$', TaskListView.as_view(), name="task_list"),
    url(r'^tasks_details/(?P<pk>[^/]+)/$',
        TaskDetailView.as_view(),
        name="tasks_details")
]
Example #15
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'),
)