コード例 #1
0
ファイル: urls.py プロジェクト: poldracklab/open_fmri
from django.conf.urls import patterns, url

from dataset.views import (DatasetCreateUpdate, DatasetDelete,
    DatasetDetail, DatasetList, FeaturedDatasetEdit,
    FeaturedDatasetDelete, UserDatasetCreate, UserDataRequestCreate,
    UserDataset, ReferencePaperCreate, ReferencePaperUpdate,
    ReferencePaperDelete, ReferencePaperList, ContactCreate, ContactUpdate,
    ContactList, ContactDelete)

from dataset.api_views import DatasetAPIList, DatasetAPIDetail

urlpatterns = patterns('',
    url(
        r'^new/$',
        DatasetCreateUpdate.as_view(),
        name='dataset_create'
    ),
    url(
        r'^edit/(?P<pk>ds\d+[a-zA-Z]?)$',
        DatasetCreateUpdate.as_view(),
        name='dataset_update'
    ),
    # this url maintains backwards compatability with old site detail view
    url(
        r'^(?P<pk>ds\d+[a-zA-Z]?)/$',
        DatasetDetail.as_view(),
        name='dataset_detail'
    ),
    url(
        r'^delete/(?P<pk>ds\d+[a-zA-Z]?)$', 
        DatasetDelete.as_view(), 
コード例 #2
0
 def test_dataset_update(self):
     found = resolve('/dataset/edit/' + str(self.dataset.accession_number))
     self.assertEqual(found.func.__name__, DatasetCreateUpdate.as_view().__name__)
コード例 #3
0
from django.conf.urls import patterns, url

from dataset.views import (
    DatasetCreateUpdate, DatasetDelete, DatasetDetail, DatasetList,
    FeaturedDatasetEdit, FeaturedDatasetDelete, UserDatasetCreate,
    UserDataRequestCreate, UserDataset, ReferencePaperCreate,
    ReferencePaperUpdate, ReferencePaperDelete, ReferencePaperList,
    ContactCreate, ContactUpdate, ContactList, ContactDelete)

from dataset.api_views import DatasetAPIList, DatasetAPIDetail

urlpatterns = patterns(
    '',
    url(r'^new/$', DatasetCreateUpdate.as_view(), name='dataset_create'),
    url(r'^edit/(?P<pk>ds\d+[a-zA-Z]?)$',
        DatasetCreateUpdate.as_view(),
        name='dataset_update'),
    # this url maintains backwards compatability with old site detail view
    url(r'^(?P<pk>ds\d+[a-zA-Z]?)/$',
        DatasetDetail.as_view(),
        name='dataset_detail'),
    url(r'^delete/(?P<pk>ds\d+[a-zA-Z]?)$',
        DatasetDelete.as_view(),
        name='dataset_delete'),
    url(r'^featured/$',
        FeaturedDatasetEdit.as_view(),
        name='featureddataset_edit'),
    url(r'^featured/delete/(?P<pk>\d+)$',
        FeaturedDatasetDelete.as_view(),
        name='featureddataset_delete'),
    url(r'^user_data_request/new/$',
コード例 #4
0
 def test_dataset_create(self):
     found = resolve('/dataset/new/')
     self.assertEqual(found.func.__name__, DatasetCreateUpdate.as_view().__name__)