コード例 #1
0
ファイル: urls.py プロジェクト: njerucyrus/kashana_work
from django.conf.urls import url
from contacts.views import (AddContact, UpdateContact, DeleteContact,
                            ListContacts, SendActivationEmailView,
                            UpdatePersonalInfo, ListContactsExport)

urlpatterns = [
    url(r'edit/$', AddContact.as_view(), name='contact_add'),
    url(r'edit/(?P<pk>\d+)/$', UpdateContact.as_view(), name='contact_update'),
    url(r'delete/(?P<pk>\d+)/$',
        DeleteContact.as_view(),
        name='contact_delete'),
    url(r'activate/(?P<pk>\d+)/$',
        SendActivationEmailView.as_view(),
        name='contact_claim_account'),
    url(r'personal/$', UpdatePersonalInfo.as_view(), name='personal_edit'),
    url(r'export_as_csv/$',
        ListContactsExport.as_view(), {'format': 'csv'},
        name='contact_list_csv'),
    url(r'export_as_excel/$',
        ListContactsExport.as_view(), {'format': 'excel'},
        name='contact_list_excel'),
    url(r'$', ListContacts.as_view(), name='contact_list'),
]
コード例 #2
0
ファイル: urls.py プロジェクト: aptivate/kashana
from django.conf.urls import url
from contacts.views import (
    AddContact, UpdateContact, DeleteContact, ListContacts,
    SendActivationEmailView,
    UpdatePersonalInfo, ListContactsExport
)


urlpatterns = [
    url(r'edit/$', AddContact.as_view(), name='contact_add'),
    url(r'edit/(?P<pk>\d+)/$', UpdateContact.as_view(),
        name='contact_update'),
    url(r'delete/(?P<pk>\d+)/$', DeleteContact.as_view(),
        name='contact_delete'),
    url(r'activate/(?P<pk>\d+)/$', SendActivationEmailView.as_view(),
        name='contact_claim_account'),
    url(r'personal/$', UpdatePersonalInfo.as_view(), name='personal_edit'),
    url(r'export_as_csv/$', ListContactsExport.as_view(), {'format': 'csv'},
        name='contact_list_csv'),
    url(r'export_as_excel/$', ListContactsExport.as_view(), {'format': 'excel'},
        name='contact_list_excel'),
    url(r'$', ListContacts.as_view(), name='contact_list'),
]
コード例 #3
0
 def test_has_expected_permissions_properties(self):
     view = DeleteContact()
     self.assertEqual(view.permission_required, 'contacts.delete_user')
     self.assertTrue(view.raise_exception)
コード例 #4
0
ファイル: urls.py プロジェクト: victorortizmx/address_book
from django.conf.urls import url
from contacts.views import EditContact, AddContact, DeleteContact

urlpatterns = [
    url(r'^edit_contact/(?P<id_contact>\d{1,})/$', EditContact.as_view(), name='edit_contact'),
    url(r'^add_contact/$', AddContact.as_view(), name="add_contact"),
    url(r'^delete_contact/(?P<id_contact>\d{1,})/$', DeleteContact.as_view(), name="delete_contact"),
]