Beispiel #1
0
 def test_project_view_returns(self):
     slug = self.valid_project.slug
     pk = self.valid_project.pk
     request = self.factory.get(
         reverse('project_detail', kwargs={'slug': slug}))
     request.user = self.staff_user
     response = ProjectDetailView.as_view()(request, pk=pk)
     self.assertEqual(response.status_code, 200)
Beispiel #2
0
 def test_project_view_renders_template(self):
     slug = self.valid_project.slug
     pk = self.valid_project.pk
     request = self.factory.get(
         reverse('project_detail', kwargs={'slug': slug}))
     request.user = self.staff_user
     response = ProjectDetailView.as_view()(request, pk=pk)
     self.assertEqual(response.template_name[0],
                      'projects/project_detail.html')
Beispiel #3
0
 def test_project_view_renders_assetgroup_list(self):
     slug = self.valid_project.slug
     pk = self.valid_project.pk
     request = self.factory.get(
         reverse('project_detail', kwargs={'slug': slug}))
     request.user = self.staff_user
     response = ProjectDetailView.as_view()(request, pk=pk)
     self.assertEqual(response.context_data['assetgroup_list'][0],
                      self.assetgroup_list[0])
Beispiel #4
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/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.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static

from projects import views as projects_views
from projects.views import ProjectDetailView

urlpatterns = [
    path('', projects_views.presentation),
    path('admin/', admin.site.urls),
    path('projects/', projects_views.list_projects),
    path('projects/<int:pk>', ProjectDetailView.as_view())
]

if settings.DEBUG is True:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Beispiel #5
0
from django.conf.urls import patterns, url

from projects.views import ProjectDetailView

urlpatterns = patterns(
    '',
    url(regex=r'^(?P<slug>[-\w]+)/$',
        view=ProjectDetailView.as_view(),
        name='project_detail'),
)
Beispiel #6
0
from django.conf.urls import patterns, url
from projects.views import ProjectListView, ProjectDetailView, ProjectTagListView, ProjectLanguageListView

urlpatterns = patterns('projects.views',
                       url(r'^$', ProjectListView.as_view(), name="projects_index"),
                       url(r'p/(?P<pk>\d+)/$', ProjectDetailView.as_view(), name="project_root"),
                       url(r'^tag/(?P<pk>\d+)/$', ProjectTagListView.as_view(), name="project_tag"),
                       url(r'^lang/(?P<pk>\d+)/', ProjectLanguageListView.as_view(), name="project_language")
                       )
Beispiel #7
0
    # Examples:
    url(r'^grappelli/', include('grappelli.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', IndexView.as_view(), name='home'),
    url(r'links/$', RedirectView.as_view(url=reverse_lazy('links-index', args=[1])) ),
    url(r'links/(?P<page>[0-9]+)/$', LinksIndexView.as_view(), name='links-index'),
    url(r'posts/$', RedirectView.as_view(url=reverse_lazy('all-index', args=[1])) ),
    url(r'posts/all/(?P<page>[0-9]+)/$', AllBlogListView.as_view(), name='all-index'),
    url(r'posts/blog/(?P<page>[0-9]+)/$', BlogBlogListView.as_view(), name='blog-index'),
    url(r'posts/post/(?P<slug>[a-zA-Z0-9-_]+)/$', BlogDetailView.as_view(), name='blog-entry'),
    url(r'software/$', RedirectView.as_view(url=reverse_lazy('software-index', args=[1])) ),
    url(r'posts/software/(?P<page>[0-9]+)/$', SoftwareBlogListView.as_view(), name='software-index'),
    url(r'reviews/$', RedirectView.as_view(url=reverse_lazy('review-index', args=[1])) ),
    url(r'posts/reviews/(?P<page>[0-9]+)/$', ReviewBlogListView.as_view(), name='reviews-index'),
    url(r'projects/$', RedirectView.as_view(url=reverse_lazy('project-index', args=[1])), name='projects' ),
    url(r'projects/(?P<page>[0-9]+)/$', ProjectListView.as_view(), name='project-index'),
    url(r'projects/(?P<slug>[a-zA-Z0-9-_]+)/$', ProjectDetailView.as_view(), name='project'),
    url(r'gallery/(?P<slug>[a-zA-Z0-9-_]+)/$', GalleryDetailView.as_view(), name='gallery'),
     #url(r'^$', 'letts_me.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    
    # Historic redirects
    url(r'blog/$', RedirectView.as_view(url=reverse_lazy('blog-index', args=[1])) ),
    url(r'blog/(?P<slug>[a-zA-Z0-9-_]+)/$', BlogDetailView.as_view(), name='blog-entry'),

) 

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
Beispiel #8
0
from django.conf.urls import url
from projects.views import ProjectListView, ProjectDetailView, ProjectTaskListView, ProjectTaskDetailView

__author__ = 'Aleh'

urlpatterns = [
    url(r'^$', ProjectListView.as_view(), name='project_list'),
    url(r'^(?P<pk>[\d]+)/$', ProjectDetailView.as_view(), name='project_detail'),
    url(r'^(?P<pk>[\d]+)/task/$', ProjectTaskListView.as_view(), name='project_task_list'),
    url(r'^(?P<pk>[\d]+)/task/(?P<task_pk>[\d]+)/$', ProjectTaskDetailView.as_view(), name='project_task_detail')
]
Beispiel #9
0
# -*- coding: utf-8 -*-
from django.conf.urls import url

from projects.views import ProjectsListView, ProjectDetailView, JoinProjectView, label_next_image, labels, label_view
from images.views import ImageLabelUpdateView

urlpatterns = [
    url(r'^$', ProjectsListView.as_view(), name='projects-list'),
    url(r'^(?P<slug>[-\w]+)/?$', ProjectDetailView.as_view(), name='porject-detail'),
    url(r'^(?P<slug>[-\w]+)/join/?$', JoinProjectView.as_view(), name='join-project'),
    url(r'^[-\w]+/image/(?P<pk>[0-9]+)/?$', ImageLabelUpdateView.as_view(), name='image-label-update'),
    url(r'^(?P<slug>[-\w]+)/next/$', label_next_image, name='label-next-image'),
    url(r'^(?P<slug>[-\w]+)/labels/$', labels, name='labels'),
    url(r'^label/(?P<labelid>[0-9]+)/$', label_view, name='label-view')
]
Beispiel #10
0
from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from projects.views import ProjectListView
from projects.views import ProjectDetailView
from projects.views import ProjectEditView
from projects.views import ProjectCreateView
from projects.views import ReferenceDetailView
from projects.views import ReferenceEditView
from projects.views import ReferenceCreateView
from projects.views import AllocationRequestDetailView
from projects.views import AllocationRequestCreateView

urlpatterns = [
    url(r'^list$', login_required(ProjectListView.as_view()), name='project-list'),
    url(r'^list/(?P<pk>[-\w]+)/$', login_required(ProjectDetailView.as_view()), name='project-detail'),
    url(r'^list/(?P<pk>[-\w]+)/edit$', login_required(ProjectEditView.as_view()), name='project-edit'),
    url(r'^create$', login_required(ProjectCreateView.as_view()), name='project-create'),
    url(r'^list/(?P<project_pk>[-\w]+)/references/(?P<pk>[-\w]+)/$', login_required(ReferenceDetailView.as_view()), name='reference-detail'),
    url(r'^list/(?P<project_pk>[-\w]+)/references/(?P<pk>[-\w]+)/edit$', login_required(ReferenceEditView.as_view()), name='reference-edit'),
    url(r'^list/(?P<project_pk>[-\w]+)/references/create$', login_required(ReferenceCreateView.as_view()), name='reference-create'),
    url(r'^list/(?P<project_pk>[-\w]+)/allocationrequests/(?P<pk>[-\w]+)/$', login_required(AllocationRequestDetailView.as_view()), name='allocation-request-detail'),
    url(r'^list/(?P<project_pk>[-\w]+)/allocationrequests/create$', login_required(AllocationRequestCreateView.as_view()), name='allocation-request-create'),
]
Beispiel #11
0
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required, login_required

from django.views.generic import DetailView, ListView, UpdateView, CreateView, DeleteView
from projects.models import Project, Deliverable, DeliverableVolume

from projects.views import ProjectListView, FilteredProjectListView, ProjectDetailView, ProjectUpdateView, ProjectCreateView, ProjectDeleteView
from projects.views import DeliverableListView, DeliverableDetailView, DeliverableUpdateView, DeliverableCreateView, DeliverableDeleteView, AddDeliverableFromProjectView
from projects.views import AddDeliverableVolumeView, DeliverableVolumeUpdateView
from qualifications.views import AddPositionFromProjectView

urlpatterns = [
    ##################################
    # Projects 
    url(r'^projects/$', ProjectListView.as_view(), name='projects_list'),
    url(r'^projects/(?P<pk>\d+)/$', ProjectDetailView.as_view(), name='project_detail'),
    url(r'^projects/create/$', ProjectCreateView.as_view(), name='create_project'),
    url(r'^projects/(?P<pk>\d+)/update/$', ProjectUpdateView.as_view(), name='update_project'),
    url(r'^projects/(?P<pk>\d+)/delete/$', ProjectDeleteView.as_view(), name='delete_project'),
    
    # Add deliverable to a project
    url(r'^projects/(?P<pk>\d+)/add_deliverable/$', AddDeliverableFromProjectView.as_view(), name='add_deliverable'),
    # Add position to a project
    url(r'^projects/(?P<pk>\d+)/add_position/$', AddPositionFromProjectView.as_view(), name='add_projectposition'),
    url(r'^projects/(?P<filter>.+)/$', FilteredProjectListView.as_view(),name='projects_list_status'),
    ##################################
    
    
    ##################################
    # Deliverables
    url(r'^deliverables/$', DeliverableListView.as_view(), name='deliverables_list' ),
from django.urls import path

from projects.views import (
    UserProjectListView,
    ClosedProjectListView,
    MemberProjectListView,
    MemberClosedProjectListView, 
    ProjectDetailView
)

urlpatterns = [
    path('', UserProjectListView.as_view(), name='project-list'),
    path('closed/', ClosedProjectListView.as_view(), name='closed-projects-list'),
    path('member/', MemberProjectListView.as_view(), name='member-projects-list'),
    path('member-closed/', MemberClosedProjectListView.as_view(), name='member-closed-projects-list'),
    path('<int:pk>/', ProjectDetailView.as_view(), name='project-detail'),
]
Beispiel #13
0
    path('category/<slug>/',
         CategorySearchView.as_view(),
         name='category-search'),
    path('email-signup/', email_list_signup, name='email-list-signup'),
    # path('create/', post_create, name='post-create'),
    path('create/', PostCreateView.as_view(), name='post-create'),
    # path('post/<id>/', post_detail, name='post-detail'),
    path('post/<slug>/', PostDetailView.as_view(), name='post-detail'),
    # path('post/<id>/update/', post_update, name='post-update'),
    path('post/<slug>/update/', PostUpdateView.as_view(), name='post-update'),
    # path('post/<id>/delete/', post_delete, name='post-delete'),
    path('post/<slug>/delete/', PostDeleteView.as_view(), name='post-delete'),
    path('tinymce/', include('tinymce.urls')),
    path('accounts/', include('allauth.urls')),
    path('projects/', ProjectListView.as_view(), name='project-list'),
    path('project/<slug>/', ProjectDetailView.as_view(),
         name='project-detail'),
    path('project/<slug>/update/',
         ProjectUpdateView.as_view(),
         name='project-update'),
    path('project/<slug>/delete/',
         ProjectDeleteView.as_view(),
         name='project-delete'),
    path('resume/', resume, name='resume'),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Beispiel #14
0
from projects.views import ProjectCreationView, ProjectCreatedView, ProjectUpdateView, \
                            ProjectUpdatedView, ProjectDetailView, HelpOfferSentView, \
                            ProjectListView, HelpOfferListView, NotificationDetailView, \
                            NotificationsListView
from django.conf.urls import patterns, url

urlpatterns = patterns('',
    url(r'^create-new-project/$',               view=ProjectCreationView.as_view(),      
        name='create-new-project'),
    url(r'^project-created/$',						view=ProjectCreatedView.as_view(),                  
        name='project-created'),
    url(r'^update-project-details/(?P<pk>\d+)/$', 	view=ProjectUpdateView.as_view(),            
        name='update-project-details'),
    url(r'^project-updated/$',						view=ProjectUpdatedView.as_view(),                  
        name='project-updated'),
    url(r'^project-details/(?P<pk>\d+)/$',          view=ProjectDetailView.as_view(),                  
        name='project-details'),
    url(r'^help-offer-sent/$',                         view=HelpOfferSentView.as_view(),                  
        name='help-offer-sent'),
    url(r'^my-projects/(?P<pk>\d+)/$',              view=ProjectListView.as_view(),            
        name='my-projects'),
    url(r'^my-help-offers/(?P<pk>\d+)/$',              view=HelpOfferListView.as_view(),            
        name='my-help-offers'),
    url(r'^notification-details/(?P<pk>\d+)/(?P<noti>\d+)/$',          view=NotificationDetailView.as_view(),            
        name='notification-details'),
    url(r'^respond-to-help-offer/(?P<pk>\d+)/(?P<status>\w+)/$',       'projects.views.respond_to_help_offer',
        name='respond-to-help-offer'),
    url(r'^my-notifications/(?P<pk>\d+)/$',         view=NotificationsListView.as_view(),
        name='my-notifications'),
    url(r'^get-notifications/(?P<param>\w+)/$',       'projects.views.get_notifications',
        name='get-notifications'),
Beispiel #15
0
from django.conf.urls import patterns, include, url
from django.conf import settings
from projects.views import ProjectCreateView, ProjectDeleteView, \
    ProjectUpdateView, ProjectDetailView, ProjectListView, \
    ProjectConfirmView, QRCodeDetailView

urlpatterns = patterns(
    '',
    url(r'^$', ProjectListView.as_view(), name='project_list'),
    url(r'^create/$', ProjectCreateView.as_view(), name='project_create'),
    url(r'^(?P<pk>\d+)/delete/$', ProjectDeleteView.as_view(),
        name='project_delete'),
    url(r'^(?P<pk>\d+)/update/$', ProjectUpdateView.as_view(),
        name='project_update'),
    url(r'^(?P<pk>\d+)/$', ProjectDetailView.as_view(),
        name='project_detail'),
    url(r'^confirm/$', ProjectConfirmView.as_view(), name='project_confirm'),
    url(r'^confirm/(?P<pk>\d+)/qrcode/$', QRCodeDetailView.as_view(),
        name="qrcode_detail")
    )
Beispiel #16
0
from django.conf.urls import url
from projects.views import (ProjectListView, ProjectCreate, ProjectDetailView,
                            ProjectUpdate)


urlpatterns = [

    url(r'^$',
        ProjectListView.as_view(),
        name='project_list'),
    url(r'^details/(?P<pk>\d+)/update/$',
        ProjectUpdate.as_view(),
        name='project_update'),
    url(r'^details/(?P<pk>\d+)/$',
        ProjectDetailView.as_view(),
        name='project_details'),
    url(r'^create/$',
        ProjectCreate.as_view(),
        name='project_create')
]