def setUp(self):
     self.view = EditFieldView.as_view()
     self.get = RequestFactory().get('/')
     self.transfield = TranslatedFieldFactory(language='bas')
     self.kwargs = {'dm' : '%s' % self.transfield.field.datamap.id,
                    'pk' : '%s' % self.transfield.field.id}
     super(EditFieldWithTranslationsTest, self).setUp()
 def setUp(self):
     self.view = EditFieldView.as_view()
     self.get = RequestFactory().get('/')
     self.datafield = DatafieldFactory(fieldname = 'testfield')
     self.kwargs = {'dm' : '%s' % self.datafield.datamap.id,
                    'pk' : '%s' % self.datafield.id}
     super(EditBasicFieldViewTest, self).setUp()
 def setUp(self):
     self.view = EditFieldView.as_view()
     self.user = UserFactory()
     self.get = RequestFactory().get('/')
     self.get.user = self.user
     self.transfield = TranslatedFieldFactory(language='bas')
     self.kwargs = {'dm': '%s' % self.transfield.field.datamap.id,
                    'pk': '%s' % self.transfield.field.id}
     super(EditFieldWithTranslationsTest, self).setUp()
    def setUp(self):
        self.view = EditFieldView.as_view()
        self.user = UserFactory()
        self.get = RequestFactory().get('/')
        self.get.user = self.user

        self.datafield = DatafieldFactory(fieldname='testfield')
        self.kwargs = {'dm': '%s' % self.datafield.datamap.id,
                       'pk': '%s' % self.datafield.id}
        super(EditBasicFieldViewTest, self).setUp()
Exemple #5
0
from django.conf.urls import patterns, url

from datamap.views.datamap_basic import (
    DatamapAddView,
    DatamapEditView,
    DatamapListView,
    DatamapView,
    DatamapJSON,
)
from datamap.views.field import (
    AddFieldView,
    EditFieldView
)

urlpatterns = patterns(
    '',
    url(r'^(?P<dm>\d+)/field/edit/(?P<pk>\d+)/$', EditFieldView.as_view(), name='datamap_field_edit'),
    url(r'^(?P<dm>\d+)/field/edit/$', AddFieldView.as_view(), name='datamap_field_add'),
    url(r'^(?P<pk>\d+)/data.json$', DatamapJSON.as_view(), name='datamap_json',),  # nopep8
    url(r'^(?P<pk>\d+)/$', DatamapView.as_view(), name='datamap',),
    url(r'^edit/(?P<pk>\d+)/$', DatamapEditView.as_view(), name='datamap_edit',),  # nopep8
    url(r'^edit/$', DatamapAddView.as_view(), name='datamap_add',),
    url(r'^$', DatamapListView.as_view(), name='datamap_list',),
)
Exemple #6
0
    FieldListView,
    FieldAllowableListView,
    FieldByConceptListView,
    FieldAllowableByConceptListView,
    FieldView,
    AddFieldView,
    EditFieldView,
)

urlpatterns = patterns(
    '',
    url(r'^(?P<dm>\d+)/field/(?P<pk>\d+)/$',
        FieldView.as_view(),
        name='datamap_field'),
    url(r'^(?P<dm>\d+)/field/edit/(?P<pk>\d+)/$',
        EditFieldView.as_view(),
        name='datamap_field_edit'),
    url(r'^(?P<dm>\d+)/field/edit/$',
        AddFieldView.as_view(),
        name='datamap_field_add'),
    url(
        r'^(?P<pk>\d+)/$',
        DatamapView.as_view(),
        name='datamap',
    ),
    url(
        r'^edit/(?P<pk>\d+)/$',
        DatamapEditView.as_view(),
        name='datamap_edit',
    ),  # nopep8
    url(