Ejemplo n.º 1
0
from django.conf.urls import include, url

from views import ProjectDetailView, ProjectCreateView, ProjectUpdateView, \
                   ProjectDeleteView, ProjectListView, create_version

urlpatterns = [
    url(r'^create/$', ProjectCreateView.as_view(), name='project-create'),
    url(r'^list/$', ProjectListView.as_view(), name='project-list'),
    url(r'^(?P<slug>[\w-]+)/$',
        ProjectDetailView.as_view(),
        name='project-detail'),
    url(r'^(?P<slug>[\w-]+)/edit/$',
        ProjectUpdateView.as_view(),
        name='project-edit'),
    url(r'^(?P<slug>[\w-]+)/delete/$',
        ProjectDeleteView.as_view(),
        name='project-delete'),
    url(r'^(?P<slug>[\w-]+)/create-version/$',
        create_version,
        name='project-create-version'),
]
Ejemplo n.º 2
0
        view=ApproveProjectView.as_view(),
        name='project-approve'),
    url(regex='^project/list/$',
        view=ProjectListView.as_view(),
        name='project-list'),
    url(regex='^project/(?P<pk>\d+)/$',
        view=ProjectDetailView.as_view(),
        name='project-detail'),
    url(regex='^project/delete/(?P<pk>\d+)/$',
        view=ProjectDeleteView.as_view(),
        name='project-delete'),
    url(regex='^project/create/$',
        view=ProjectCreateView.as_view(),
        name='project-create'),
    url(regex='^project/update/(?P<pk>\d+)/$',
        view=ProjectUpdateView.as_view(),
        name='project-update'),

    # Category management

    # This view is only accessible via ajax
    url(regex='^json-category/list/(?P<version>\d+)/$',
        view=JSONCategoryListView.as_view(),
        name='json-category-list'),
    url(regex='^pending-category/list/$',
        view=PendingCategoryListView.as_view(),
        name='pending-category-list'),
    url(regex='^approve-category/(?P<pk>\d+)/$',
        view=ApproveCategoryView.as_view(),
        name='category-approve'),
    url(regex='^category/list/$',
Ejemplo n.º 3
0
from django.conf.urls import include, url

from views import ProjectDetailView, ProjectCreateView, ProjectUpdateView, \
                   ProjectDeleteView, ProjectListView, create_version


urlpatterns = [
    url(r'^create/$', ProjectCreateView.as_view(), name='project-create'),
    url(r'^list/$', ProjectListView.as_view(), name='project-list'),
    url(r'^(?P<slug>[\w-]+)/$', ProjectDetailView.as_view(), name='project-detail'),
    url(r'^(?P<slug>[\w-]+)/edit/$', ProjectUpdateView.as_view(), name='project-edit'),
    url(r'^(?P<slug>[\w-]+)/delete/$', ProjectDeleteView.as_view(), name='project-delete'),
    url(r'^(?P<slug>[\w-]+)/create-version/$', create_version, name='project-create-version'),
]
Ejemplo n.º 4
0
    ProjectDeleteView,
    ProjectCreateView,
    ProjectListView,
    ProjectUpdateView,
    PendingProjectListView,
    ApproveProjectView,
    ProjectBallotListView,
)

urlpatterns = patterns(
    "",
    # basic app views
    url(regex="^$", view=ProjectListView.as_view(), name="home"),
    # Project management
    url(regex="^pending-project/list/$", view=PendingProjectListView.as_view(), name="pending-project-list"),
    url(regex="^approve-project/(?P<slug>[\w-]+)/$", view=ApproveProjectView.as_view(), name="project-approve"),
    url(regex="^project/list/$", view=ProjectListView.as_view(), name="project-list"),
    url(regex="^(?P<slug>[\w-]+)/$", view=ProjectDetailView.as_view(), name="project-detail"),
    url(regex="^(?P<slug>[\w-]+)/ballots/$", view=ProjectBallotListView.as_view(), name="project-ballot-list"),
    url(regex="^project/(?P<slug>[\w-]+)/delete/$", view=ProjectDeleteView.as_view(), name="project-delete"),
    url(regex="^project/create/$", view=ProjectCreateView.as_view(), name="project-create"),
    url(regex="^project/(?P<slug>[\w-]+)/update/$", view=ProjectUpdateView.as_view(), name="project-update"),
)


if settings.DEBUG:
    # static files (images, css, javascript, etc.)
    urlpatterns += patterns(
        "", (r"^media/(?P<path>.*)$", "django.views.static.serve", {"document_root": settings.MEDIA_ROOT})
    )