コード例 #1
0
    def __init__(self):
        tnb = self.get_base_name()
        OCreateView = self.get_create_view()
        self.create = login_required(OCreateView.as_view(
            model=self.model,
            fields=self.fields,
            success_url=reverse_lazy(self.namespace + ':objectview_list'),
            template_name=tnb + "_form.html"
        ))

        OUpdateView = self.get_edit_view()
        self.edit = login_required(OUpdateView.as_view(
            model=self.model,
            fields=self.fields,
            success_url=reverse_lazy(self.namespace + ':objectview_list'),
            template_name=tnb + "_form.html"
        ))

        self.delete = login_required(DeleteView.as_view(
            model=self.model,
            success_url=reverse_lazy(self.namespace + ':objectview_list'),
            template_name=tnb + "_delete.html"
        ))

        OListView = self.get_list_view()
        self.list = login_required(OListView.as_view(
            model=self.model,
            paginate_by=10,
            template_name=tnb + "_list.html"
        ))
コード例 #2
0
ファイル: laboratory.py プロジェクト: kanguarrovi/organilab
    def __init__(self):
        self.create = login_required(
            CreateView.as_view(
                model=self.model,
                fields=('name', ),
                success_url=reverse_lazy('laboratory:laboratory_list'),
                template_name=self.template_name_base + 'form.html'))

        self.edit = login_required(
            UpdateView.as_view(
                model=self.model,
                fields=('name', ),
                success_url=reverse_lazy('laboratory:laboratory_list'),
                template_name=self.template_name_base + 'form.html'))

        self.delete = login_required(
            DeleteView.as_view(
                model=self.model,
                success_url=reverse_lazy('laboratory:laboratory_list'),
                template_name=self.template_name_base + 'delete.html'))

        self.list = login_required(
            ListView.as_view(model=self.model,
                             paginate_by=10,
                             template_name=self.template_name_base +
                             'list.html'))
コード例 #3
0
ファイル: laboratory.py プロジェクト: solvo/organilab
    def __init__(self):
        self.create = login_required(CreateView.as_view(
            model=self.model,
            fields=('name',),
            success_url=reverse_lazy('laboratory:laboratory_list'),
            template_name=self.template_name_base + 'form.html'
        ))

        self.edit = login_required(UpdateView.as_view(
            model=self.model,
            fields=('name',),
            success_url=reverse_lazy('laboratory:laboratory_list'),
            template_name=self.template_name_base + 'form.html'
        ))

        self.delete = login_required(DeleteView.as_view(
            model=self.model,
            success_url=reverse_lazy('laboratory:laboratory_list'),
            template_name=self.template_name_base + 'delete.html'
        ))

        self.list = login_required(ListView.as_view(
            model=self.model,
            paginate_by=10,
            template_name=self.template_name_base + 'list.html'
        ))
コード例 #4
0
ファイル: urls.py プロジェクト: lpatkowski/Milo
from django.conf.urls import url
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from milo.users.models import User

urlpatterns = [
    url(r'^$', ListView.as_view(
            queryset=User.objects.order_by('-id'),
            context_object_name='users_list',
            template_name='users/users_list.html'),
            name='users-list'),
    url(r'^create/$', CreateView.as_view(
            model=User,
            template_name_suffix='_create_form',
            fields=['username','password','birthday_date','random_number']),
            name='user-create'),
    url(r'^edit/(?P<pk>[^/]+)/$', UpdateView.as_view(
            model=User,
            template_name_suffix='_edit_form',
            fields=['username','password','birthday_date','random_number']),
            name='user-edit'),
    url(r'^delete/(?P<pk>[^/]+)/$', DeleteView.as_view(
            model=User,
            template_name_suffix='_delete_form',
            success_url='/'),
            name='user-delete'),
    url(r'^csv_export/$', 'milo.users.views.export_csv',name='csv-list'),
]

コード例 #5
0
ファイル: urls.py プロジェクト: HowlingEverett/AgainstDragons
        context_object_name='surveys'
    )), name="survey_list"),

    # Survey CRUD
    url(r'^survey/create/$', permission_required('geosurvey.add_survey')(CreateView.as_view(
        model=Survey,
        template_name='dashboard/survey_form.html',
        success_url=reverse_lazy('survey_list'),
    )), name="survey_create"),
    url(r'^survey/(?P<pk>\d+)/edit/$', permission_required('geosurvey.change_survey')(UpdateView.as_view(
        model=Survey,
        template_name='dashboard/survey_form.html',
        success_url=reverse_lazy('survey_list'),
    )), name="survey_edit"),
    url(r'^survey/(?P<pk>\d+)/delete/$', permission_required('geosurvey.delete_survey')(DeleteView.as_view(
        model=Survey,
        success_url=reverse_lazy('survey_list'),
    )), name="survey_delete"),

    # Survey Detail URLs
    url(r'^survey/(?P<pk>\d+)/$', login_required(SurveyDetailView.as_view(
            model=Survey,
            template_name='dashboard/survey_detail.html'
        )), name="survey_detail"),
    url(r'^trip/(?P<pk>\d+)/$', login_required(TripDetailView.as_view(
        model=Trip,
        template_name="dashboard/trip_detail.html"
    )), name="trip_detail"),

    # Export URLs
    url(r'^survey/(?P<pk>\d+)/export/$', login_required(SurveyExportView.as_view(
コード例 #6
0
ファイル: urls.py プロジェクト: MechanisM/tinygraph
from django.conf.urls.defaults import *
from django.views.generic.edit import CreateView, DeleteView
from tinygraph.apps.definitions.models import Package
from tinygraph.apps.definitions.forms import PackageForm

urlpatterns = patterns('definitions.views',
    url(r'^mibs/$', 'mib_upload_list', name='mib_upload_list'),
    
    url(r'^packages/$', 'package_list', name='package_list'),
    url(r'^packages/add/$', CreateView.as_view(
        model=Package,
        template_name='definitions/packages/package_form.html',
        form_class=PackageForm,
    ), name='package_add'),
    url(r'^packages/(?P<package_slug>[-\w]+)/$', 'package_detail', name='package_detail'),
    url(r'^packages/(?P<slug>[-\w]+)/delete$', DeleteView.as_view(
        model=Package,
        template_name='definitions/packages/package_delete.html',
        success_url='/data/packages/',
    ), name='package_delete'),

    url(r'^$', 'data_object_list', name='data_object_list'),
)
コード例 #7
0
ファイル: urls.py プロジェクト: theseusyang/geoevents
                                                                        template_name='report.html',
                       ), name='reports-view-report'),
                       url(r'^report/add/$', permission_required('director.add_report', reverse_lazy('home'))(
                           ReportCreateView.as_view(template_name='report-manage.html',
                                                    success_url=reverse_lazy('reports-view-reports'),
                           )), name='reports-manage-report'),
                       url(r'^report/manage/(?P<pk>\d+)/$',
                           permission_required('director.change_report', reverse_lazy('home'))(
                               UpdateView.as_view(queryset=Report.objects.all(),
                                                  form_class=ReportForm,
                                                  template_name='report-manage.html',
                               )), name='reports-manage-report-id'),
                       url(r'^report/delete/(?P<pk>\d+)/$',
                           permission_required('director.delete_report', reverse_lazy('home'))(
                               DeleteView.as_view(model=Report,
                                                  template_name='generic-delete.html',
                                                  success_url=reverse_lazy('reports-view-reports'))
                           ), name='reports-delete-report-id'),


                       url(r'^action/(?P<pk>\d+)/$', DetailView.as_view(queryset=Actions.objects.all(),
                                                                        template_name='report.html',
                       ), name='actions-view-report'),
                       url(r'^action/new/$', 'geoevents.director.views.ActionNew', name='actions-submit-new'),
                       url(r'^action/add/(?P<success_url>.*)$',
                           ActionCreateView.as_view(template_name='report-manage.html', ),
                           name='actions-manage-report-return'),
                       url(r'^action/add/$', permission_required('director.add_actions', reverse_lazy('home'))(
                           ActionCreateView.as_view(template_name='report-manage.html',
                                                    success_url=reverse_lazy('actions-view-reports'),
                           )), name='actions-manage-report'),
コード例 #8
0
         LibraryView.as_view(template_name="imager_images/library.html")),
     name='my_library'),
 url(r'^photo/create/$',
     login_required(PhotoCreate.as_view()),
     name='photo_create'),
 url(r'^photo/edit/(?P<pk>[0-9]+)/$',
     login_required(
         UpdateView.as_view(template_name="imager_images/photo_edit.html",
                            model=Photo,
                            fields=PHOTO_FORM_FIELDS,
                            success_url=reverse_lazy('my_library'))),
     name='photo_edit'),
 url(r'^photo/delete/(?P<pk>[0-9]+)/$',
     login_required(
         DeleteView.as_view(template_name="imager_images/photo_delete.html",
                            model=Photo,
                            success_url=reverse_lazy('my_library'))),
     name='photo_delete'),
 url(r'^album/create/$',
     login_required(AlbumCreate.as_view()),
     name='album_create'),
 url(r'^album/edit/(?P<pk>[0-9]+)/$',
     login_required(
         UpdateView.as_view(template_name="imager_images/album_edit.html",
                            model=Album,
                            fields=ALBUM_FORM_FIELDS,
                            success_url=reverse_lazy('my_library'))),
     name='album_edit'),
 url(r'^album/delete/(?P<pk>[0-9]+)/$',
     login_required(
         DeleteView.as_view(template_name="imager_images/album_delete.html",
コード例 #9
0
ファイル: urls.py プロジェクト: onary/pastebin
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.detail import DetailView
from django.views.generic.edit import DeleteView

from paste.models import Paste

admin.autodiscover()

urlpatterns = patterns('',
	url(r'^$', 'paste.views.home', name='home'),
	url(r'^paste/(?P<pk>\d+)$', DetailView.as_view(model=Paste,
									context_object_name='paste',
									template_name='paste.html'
									), name='paste'),
	url(r'^repaire/(?P<pk>\d+)$', 'paste.views.home', name='repaire'),
	url(r'^delete/(?P<pk>\d+)$', DeleteView.as_view(model=Paste,
									success_url='/',
									template_name='item_confirm_delete.html'
									), name='delete'),
	url(r'^admin/', include(admin.site.urls)),
	(r'^i18n/', include('django.conf.urls.i18n')),
)
コード例 #10
0
ファイル: urls.py プロジェクト: ankitrajshree/python-ocrlab
    url(r'^progress/(?P<task_id>[a-z0-9-]+)/?$',
            views.progress, name='ocr_progress'),

    url(r'^presets/?$', ListView.as_view(
            model=models.Preset,
            template_name="object_list.html",
            paginate_by=PAGINATE_BY), name="preset_list"),
    url(r'^presets/create/?$', CreateView.as_view(
            model=models.Preset,
            template_name="object_create.html",
            success_url=reverse_lazy("preset_list")
            ), name="preset_create"),
    url(r'^presets/update/(?P<slug>[-\w]+)/?$', UpdateView.as_view(
            model=models.Preset,
            template_name="object_update.html",
            success_url=reverse_lazy("preset_list")
            ), name="preset_update"),
    url(r'^presets/delete/(?P<slug>[-\w]+)/?$', DeleteView.as_view(
            model=models.Preset,
            template_name="object_delete.html",
            success_url=reverse_lazy("preset_list")
            ), name="preset_delete"),
    url(r'^presets/detail/(?P<slug>[-\w]+)/?$', DetailView.as_view(
            model=models.Preset,
            template_name="object_detail.html"
            ), name="preset_detail"),

)


コード例 #11
0
ファイル: urls.py プロジェクト: nikolas/rolf
}

site_media_root = os.path.join(os.path.dirname(__file__), "../media")

accounts_tuple = (r'^accounts/', include('django.contrib.auth.urls'))

urlpatterns = patterns(
    '',
    (r'^$', 'rolf.rolf_main.views.index'),
    (r'^category/add/', 'rolf.rolf_main.views.add_category'),
    (r'^category/(?P<object_id>\d+)/$', 'rolf.rolf_main.views.generic_detail',
     category_info_dict),
    (r'^category/(?P<object_id>\d+)/add_application/$',
     'rolf.rolf_main.views.add_application'),
    (r'^category/(?P<pk>\d+)/delete/$',
     DeleteView.as_view(model=Category, success_url="/")),
    (r'^application/(?P<object_id>\d+)/$',
     'rolf.rolf_main.views.generic_detail', application_info_dict),
    (r'^application/(?P<object_id>\d+)/add_deployment/$',
     'rolf.rolf_main.views.add_deployment'),
    (r'^application/(?P<pk>\d+)/delete/$',
     DeleteView.as_view(model=Application, success_url="/")),
    (r'^deployment/(?P<object_id>\d+)/$',
     'rolf.rolf_main.views.generic_detail', deployment_info_dict),
    (r'^deployment/(?P<object_id>\d+)/add_setting/$',
     'rolf.rolf_main.views.add_setting'),
    (r'^deployment/(?P<object_id>\d+)/edit_settings/$',
     'rolf.rolf_main.views.edit_settings'),
    (r'^deployment/(?P<object_id>\d+)/add_stage/$',
     'rolf.rolf_main.views.add_stage'),
    (r'^deployment/(?P<object_id>\d+)/clone/$',
コード例 #12
0
                           success_url='/employees')),
    #url(r'^employees/update/(?P<object_id>\d+)/$', 'django.views.generic.edit.UpdateView',
    #dict(employee_info, template_name='employees/employee_form.html', post_save_redirect='/employees/')),
    url(
        r'^employees/update/(?P<pk>\d+)/$',
        UpdateView.as_view(model=Emp,
                           fields=[
                               'empno', 'ename', 'job', 'mgr', 'hiredate',
                               'sal', 'comm', 'deptno'
                           ],
                           template_name='employee_form.html',
                           success_url='/employees')),
    url(
        r'^employees/delete/(?P<pk>\d+)/$',
        DeleteView.as_view(model=Emp,
                           template_name='employee_confirm_delete.html',
                           success_url='/employees')),
    #url(r'^employees/delete/(?P<object_id>\d+)/$', 'django.views.generic.edit.DeleteView',
    #dict(employee_info, template_name='employees/employee_confirm_delete.html',post_delete_redirect='/employees/')),
    url(
        r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root':
            'C:/DjangoPythonWorkSpace/EmpMgmtOracle/mysite/EmpMgmtApp/static'
        }),
    #url(r'^mysite/', include('mysite.foo.urls')),
]

#if settings.DEBUG:
#    urlpatterns += static(settings.STATIC_URL,
#                          document_root=settings.STATIC_ROOT)
#    urlpatterns += static(settings.MEDIA_URL,
コード例 #13
0
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.views.generic.edit import DeleteView
from django.views.generic.base import TemplateView
from beneficiaire.models import Beneficiaire
from beneficiaire.views import ListBeneficiaire, DetailBeneficiaire, CreerBeneficiaire, UpdateBeneficiaire
from projet.views import *

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TemplateView.as_view(template_name="accueil.html"), name="accueil"),
    path('beneficiaire/', ListBeneficiaire.as_view(template_name="list_benef_grid.html"), name="list_beneficiaire"),
    path('beneficiaire/table/', ListBeneficiaire.as_view(template_name="list_benef_table.html"), name="list_beneficiaire"),
    path('beneficiaire/<int:pk>/', DetailBeneficiaire.as_view(), name="detail_beneficiaire"),
    path('beneficiaire/ajout/', CreerBeneficiaire.as_view(), name="creer_beneficiaire"),
    path('beneficiaire/<int:pk>/editer/', UpdateBeneficiaire.as_view(), name="update_beneficiaire"),
    path('beneficiaire/<int:pk>/supprimer/', DeleteView.as_view(model=Beneficiaire, success_url="/beneficiaire/"), name="supprimer_beneficiaire"),
    path('projet/', ListProjet.as_view(), name="list_projet"),
    path('projet/<int:pk>/', DetailProjet.as_view(), name="detail_projet"),
    path('projet/ajout/', CreerProjet.as_view(), name="ajout_projet"),
    path('projet/<int:pk>/editer/', EditerProjet.as_view(), name="editer_projet"),
    path('projet/<int:pk>/supprimer/', DeleteProjet.as_view(), name="supprimer_projet"),
]
コード例 #14
0
ファイル: urls.py プロジェクト: bdeshaz/questions-box
                    paginate_by=30,
                    ), name='view_questions'),

    url(r'^tags/', ListView.as_view(
                    model=models.Tag,
                    template_name="tags/tags.html",
                    context_object_name='tags',
                    paginate_by=30,
                    ), name='view_tags'),

    url(r'^ask/', views.AskQuestionView.as_view(), name='ask_question'),
    url(r'^q/(?P<pk>\d+)', views.QuestionDetailView.as_view(), name="show_question"),
    url(r'^q_tag/(?P<pk>\d+)', views.AddTagView.as_view(), name="add_tag"),
    url(r'^tag/(?P<pk>\d+)', views.TagDetailView.as_view(), name="view_tag"),
    url(r'^dtag/(?P<pk>\d+)', DeleteView.as_view(
                    model=models.Tag,
                    success_url='/tags/',), name="delete_tag"),

    # Voting redirect views
    url(r'^Qdownvote/(?P<pk>\d+)', views.QuestionDownvoteView.as_view(),
                                        name='question_downvote'),
    url(r'^QCupvote/(?P<pk>\d+)', views.QuestionCommentUpvoteView.as_view(),
                                        name='question_comment_upvote'),
    #   on answers
    url(r'^Aupvote/(?P<pk>\d+)', views.AnswerUpvoteView.as_view(),
                                        name='answer_upvote'),
    url(r'^Adownvote/(?P<pk>\d+)', views.AnswerDownvoteView.as_view(),
                                        name='answer_downvote'),
    url(r'^Qupvote/(?P<pk>\d+)', views.QuestionUpvoteView.as_view(),
                                        name='question_upvote'),
    url(r'^ACupvote/(?P<pk>\d+)', views.AnswerCommentUpvoteView.as_view(),
コード例 #15
0
ファイル: urls.py プロジェクト: JohnWilson12345/geoevents
                       url(r'^manage/$', (NoteCreateView.as_view(template_name='note-manage.html',
                                                                 success_url=reverse_lazy('notes-view-notes'),
                       )), name='notes-manage-note'),

                       url(r'^manage/(?P<pk>\d+)/$', (UpdateView.as_view(queryset=Note.objects.all(),
                                                                         form_class=NoteForm,
                                                                         template_name='note-manage.html',
                       )), name='notes-manage-note-id'),

                       url(r'^manage/(?P<model>\w+)/(?P<pk>\d+)/(?P<source_url>.*)$',
                           (NoteCreateView.as_view(template_name='note-manage.html',
                                                   form_class=NoteFormMinimal)),
                           name='notes-manage-note-model-id',
                       ),

                       url(r'^manage/(?P<model>\w+)/(?P<pk>\d+)/$',
                           (NoteCreateView.as_view(template_name='note-manage.html',
                                                   success_url=reverse_lazy('notes-view-notes'),
                                                   form_class=NoteFormMinimal)),
                           name='notes-manage-note-model-id',
                       ),


                       url(r'^delete/(?P<pk>\d+)/$',
                           permission_required('notes.delete_note', reverse_lazy('home'))(DeleteView.as_view(model=Note,
                                                                                                             template_name='generic-delete.html',
                                                                                                             success_url=reverse_lazy('notes-view-notes'))
                           ), name='notes-delete-note-id'),
)
コード例 #16
0
ファイル: urls.py プロジェクト: ccnmtl/capsim
    url(r'^topics/$', TemplateView.as_view(template_name="main/topics.html")),
    url(r'^topic-obesity/$', TemplateView.as_view(
        template_name="sim/topic-obesity.html")),
    url(r'^topic-obesity-debrief/$', TemplateView.as_view(
        template_name="sim/topic-obesity-debrief.html")),
    url(r'^proposal/$', TemplateView.as_view(
        template_name="sim/proposal.html")),
    url(r'^run/new/$', capsim.main.views.NewRunView.as_view()),
    url(r'^run/$', capsim.sim.views.RunsView.as_view()),
    url(r'^run/compare/$', capsim.sim.views.CompareRunsView.as_view()),
    url(r'^run/toggle/$', capsim.main.views.ToggleFlagView.as_view()),
    url(r'^run/(?P<id>\d+)/$', capsim.sim.views.RunView.as_view()),
    url(r'^run/(?P<pk>\d+)/json/$', capsim.sim.views.RunOutputView.as_view()),
    url(r'^run/(?P<pk>\d+)/edit/$', capsim.sim.views.RunEditView.as_view()),
    url(r'^run/(?P<pk>\d+)/delete/$',
        DeleteView.as_view(model=RunRecord, success_url="/run/")),

    url(r'^experiment/new/$', capsim.sim.views.NewExperimentView.as_view()),
    url(r'^experiment/$', capsim.sim.views.ExperimentListView.as_view()),
    url(r'^experiment/(?P<pk>\d+)/$', DetailView.as_view(model=Experiment)),
    url(r'^experiment/(?P<pk>\d+)/csv/$',
        capsim.sim.views.ExperimentOutputView.as_view()),
    url(r'^experiment/(?P<pk>\d+)/fullcsv/$',
        capsim.sim.views.ExperimentFullOutputView.as_view()),
    url(r'^experiment/(?P<pk>\d+)/heatmap/$',
        DetailView.as_view(
            model=Experiment,
            template_name="sim/experiment_heatmap.html")),
    url(r'^experiment/(?P<pk>\d+)/delete/$',
        capsim.sim.views.ExperimentDeleteView.as_view()),
    url(r'^experiment/(?P<pk>\d+)/reenqueue/$',
コード例 #17
0
from django.conf.urls import patterns, url
from django_view_dispatch import dispatch
from django.views.generic.edit import DeleteView
from django.core.urlresolvers import reverse_lazy

from events.models import Event

from . import views

from .utils import user_can_add_events


urlpatterns = patterns('administration.views',
    url(r'^$', user_can_add_events(dispatch(get=views.dashboard, post=views.add_event)), name='administration_dashboard'),
    url(r'^event/(?P<pk>\d+)/update/$', user_can_add_events(dispatch(get=views.update_event, post=views.update_event_post)), name='administration_event_update'),
    url(r'^event/(?P<pk>\d+)/delete/$', user_can_add_events(DeleteView.as_view(model=Event, template_name="administration/event_confirm_delete.haml", success_url=reverse_lazy('administration_dashboard'))), name='administration_event_delete'),
)
コード例 #18
0
ファイル: urls.py プロジェクト: Etxea/webminar
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib.auth.decorators import login_required

from django.views.generic import TemplateView
from django.views.generic import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

from videowm.models import *
from videowm.forms import *
from views import *


urlpatterns = patterns("",
    url(r"^$", login_required(WebminarGestionList.as_view()), name="webminar_gestion_lista"),
    url(r"^nuevo/$", login_required(CreateView.as_view(model=Webminar,form_class=WebminarForm)), name="webminar_nuevo"),
    url(r"^editar/(?P<pk>\d+)/$", login_required(UpdateView.as_view(model=Webminar,form_class=WebminarForm)), name="webminar_editar"),
    url(r"^borrar/(?P<pk>\d+)/$", login_required(DeleteView.as_view(model=Webminar,success_url="/gestion/")), name="webminar_borrar"),
    url(r"^realizar/(?P<pk>\d+)/$", login_required(WebminarRealizar.as_view()), name="webminar_realizar"),
    url(r"^exportar/(?P<pk>\d+)/mensajes/$", exportar_mensajes, name="webminar_exportar_mensajes"),
    url(r"^exportar/(?P<pk>\d+)/visitas/$", exportar_visitas, name="webminar_exportar_visitas"),
    )
コード例 #19
0
ファイル: urls.py プロジェクト: bilougit/english_level
from django.conf.urls import patterns, url
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy

from dydict.views import contactView, HelpView, CreateDict, dictList
from dydict.models import Dict
from dydict.forms import WordForm


urlpatterns = patterns('dydict.views',
    # Generic views
    url(r'^list/(?P<page>\d+)$', login_required(dictList), name="list"),
    url(r'^(?P<pk>\d+)/details/$', DetailView.as_view(model=Dict),
        name="details"),
    url(r'^(?P<pk>\d+)/update/$', UpdateView.as_view(model=Dict,
      form_class=WordForm), name='update'),
    url(r'^create/$', CreateDict.as_view(), name='create'),
    url(r'^(?P<pk>\d+)/delete/$', DeleteView.as_view(
      model=Dict, success_url=reverse_lazy('list')), name='delete'),
    #url(r'^show_words/?$', 'listWords'),
    #url(r'^show_words/(?P<page_number>\d{1})/?$', 'listWords'),
    url(r'^contact/$', contactView, name="contact"),
    url(r'^help/$', HelpView.as_view(), name="dydict_help"),
)
コード例 #20
0
 (r'^about/$', TemplateView.as_view(template_name="main/about.html")),
 (r'^topics/$', TemplateView.as_view(template_name="main/topics.html")),
 (r'^topic-obesity/$',
  TemplateView.as_view(template_name="sim/topic-obesity.html")),
 (r'^topic-obesity-debrief/$',
  TemplateView.as_view(template_name="sim/topic-obesity-debrief.html")),
 (r'^proposal/$', TemplateView.as_view(template_name="sim/proposal.html")),
 (r'^run/new/$', capsim.main.views.NewRunView.as_view()),
 (r'^run/$', capsim.sim.views.RunsView.as_view()),
 (r'^run/compare/$', capsim.sim.views.CompareRunsView.as_view()),
 (r'^run/toggle/$', capsim.main.views.ToggleFlagView.as_view()),
 (r'^run/(?P<id>\d+)/$', capsim.sim.views.RunView.as_view()),
 (r'^run/(?P<pk>\d+)/json/$', capsim.sim.views.RunOutputView.as_view()),
 (r'^run/(?P<pk>\d+)/edit/$', capsim.sim.views.RunEditView.as_view()),
 (r'^run/(?P<pk>\d+)/delete/$',
  DeleteView.as_view(model=RunRecord, success_url="/run/")),
 (r'^experiment/new/$', capsim.sim.views.NewExperimentView.as_view()),
 (r'^experiment/$', capsim.sim.views.ExperimentListView.as_view()),
 (r'^experiment/(?P<pk>\d+)/$', DetailView.as_view(model=Experiment)),
 (r'^experiment/(?P<pk>\d+)/csv/$',
  capsim.sim.views.ExperimentOutputView.as_view()),
 (r'^experiment/(?P<pk>\d+)/fullcsv/$',
  capsim.sim.views.ExperimentFullOutputView.as_view()),
 (r'^experiment/(?P<pk>\d+)/heatmap/$',
  DetailView.as_view(model=Experiment,
                     template_name="sim/experiment_heatmap.html")),
 (r'^experiment/(?P<pk>\d+)/delete/$',
  capsim.sim.views.ExperimentDeleteView.as_view()),
 (r'^experiment/(?P<pk>\d+)/reenqueue/$',
  capsim.sim.views.ExperimentReEnqueueView.as_view()),
 (r'^calibrate/$',
コード例 #21
0
ファイル: urls.py プロジェクト: al-layth/denigma
    url(r'^entry/(?P<slug>.+)/?$', 'entry',
        name='data_entry'),  # Classic view.
    url(r'^entry/add', 'add_entry', name='add_entry'),
    url(r'^entry/edit', 'edit_entry', name='edit_view'),
    url(r'^entry/remove', 'remove_entry', name='remove_entry'),
    url(r'^entry/breadcrump/(?P<slug>.+)', 'breadcrump',
        name='breadcrump'),  # An experimental view to display breadcrump.

    # Changes:
    ## Class-Views
    url(r'^changes/list/$', ChangeList.as_view(), name='list-changes'),
    url(r'^change/details/(?P<pk>\d+)',
        DetailView.as_view(model=Change),
        name='detail-change'),  #detail-change
    url(r'^change/delete/(?P<pk>\d+)',
        DeleteView.as_view(model=Change),
        name='delete-change'),
    ## Function-Views:
    url(r'^changes/(?P<pk>\d*)', 'changes', name='changes'),
    url(r'^change/remove/(?P<slug>.+)/$',
        'remove_change',
        name='remove_change'),
    url(r'^change/feed/$', ChangeFeed(), name='data-change-feed'),
    url(r'^change/(?P<pk>\d*)/$', ChangeView.as_view(), name='change'),
    url(r'^change/(?P<slug>.+)/$', ChangeView.as_view(), name='change'),

    # Relations:
    ## Class-Views
    url(r'^relations/list', RelationList.as_view(), name='list-relations'),
    url(r'^relation/generate/(?P<source>.+)/(?P<type>.+)/(?P<target>.+)',
        login_required(GenerateRelation.as_view()),
コード例 #22
0
          context_object_name='obj',
          success_url=reverse_lazy('cynr_app:instituciones_crud'),
          extra_context={
              'contenido': contenidos.contextoPagInst,
          },
          form_class=forms.FormInstitucion,
          template_name='cynr_app/modalUpdateItemWithFile.html',
      ),
      name='instituciones_crud_editar'),
 # ELIMINAR INSTITUCION
 path('instituciones_crud_eliminar/<int:pk>',
      DeleteView.as_view(
          model=Instituciones,
          context_object_name='obj',
          success_url=reverse_lazy('cynr_app:instituciones_crud'),
          extra_context={
              'contenido': contenidos.contextoPagInst,
          },
          template_name='cynr_app/modalDeleteItem.html',
      ),
      name='instituciones_crud_eliminar'),
 ####################################################################
 #- DOCUMENTOS INSTITUCIONES
 ####################################################################
 # CRUD DOC INSTITUCIONES
 path(
     'doc_instituciones_crud/',
     ListView.as_view(
         #queryset = contenidos.querysetPagDocInst,
         queryset=DocInstitucionales.objects.all().values(
             'autor_id__username', 'id', 'nombre', 'presentacion',
コード例 #23
0
ファイル: urls.py プロジェクト: thraxil/gearspotting
from django.conf.urls import url
from gearspotting.musiciangear.models import MusicianGear
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from gearspotting.musiciangear.views import (AddLinkView, AddPhotoView,
                                             EditLinksView, EditPhotosView)

urlpatterns = [
    url(r'^$', ListView.as_view(model=MusicianGear)),
    url(r'^create/?$', CreateView.as_view(model=MusicianGear)),
    url(r'^(?P<object_id>\d+)/update/?$',
        UpdateView.as_view(model=MusicianGear)),
    url(r'^(?P<object_id>\d+)/delete/?$',
        DeleteView.as_view(model=MusicianGear)),
    url(r'^(?P<pk>\d+)/$', DetailView.as_view(model=MusicianGear)),
    url(r'^(?P<id>\d+)/edit_links/?$', EditLinksView.as_view()),
    url(r'^(?P<id>\d+)/edit_photos/?$', EditPhotosView.as_view()),
    url(r'^(?P<id>\d+)/add_link/$', AddLinkView.as_view()),
    url(r'^(?P<id>\d+)/add_photo/$', AddPhotoView.as_view()),
]
コード例 #24
0
ファイル: urls.py プロジェクト: FornitFornus/git
    url(r'^home/sms_list_zaladowany$',
        views.sms_list_zaladowany,
        name='sms_list_zaladowany'),
    url(r'^home/sms_list_rozladowany$',
        views.sms_list_rozladowany,
        name='sms_list_rozladowany'),
    url(r'^home/sms_list_all$', views.sms_list_all, name='sms_list_all'),
    #url(r'^home/kierowca$', views.kierowca_new, name='kierowca_new'),
    url(r'^home/kierowca', views.UtworzKierowce.as_view()),
    url(
        r'^home/zlecenie', views.UtworzZlecenie.as_view()
    ),  ##views.utworz_zlecenie, name='utworz_zlecenie'),##views.UtworzZlecenie.as_view()),
    url(r'^home/zlecenia', views.PokazZlecenia.as_view()),
    url(r'^home/edytuj/(?P<pk>\d+)/',
        views.EdytujKierowce.as_view(),
        name='edytuj'),
    url(r'^home/wyslij_sms/(?P<pk>\d+)/',
        WyslijSMS.as_view(model=Kierowca,
                          template_name='sms_controll/sms_form.html',
                          success_url='/home/kierowcy'),
        name='wyslij_sms'),
    url(r'^home/usun/(?P<pk>\d+)/',
        DeleteView.as_view(model=Kierowca,
                           template_name='sms_controll/kierowca_usun.html',
                           success_url='/home/kierowcy'),
        name='usun'),
    #url(r'^home/kierowcy$', ListView.as_view(model = Kierowca, context_object_name = 'kierowca'), name='kierowca_list'),
    url(r'^home/kierowcy/', KierowcyList.as_view()),
    url(r'^wyloguj/$', views.wyloguj, name='wyloguj'),
    #url(r'^logout/$', 'django.contrib.auth.views.logout',{'next page': 'index',}, name='logout'),
]
コード例 #25
0
ファイル: urls.py プロジェクト: jradd/django-polls
        ListView.as_view(
            queryset=Book.objects.all(),
            template_name='model_filefields_example/book_list.html'),
        name='book.list'),
    url(r'^books/add/$',
        CreateView.as_view(
            model=Book,
            form_class=BookForm,
            template_name='model_filefields_example/book_form.html',
            success_url=reverse_lazy('model_files:book.list')),
        name='book.add'),
    url(r'^books/edit/(?P<pk>\d+)/$',
        UpdateView.as_view(
            model=Book,
            form_class=BookForm,
            template_name='model_filefields_example/book_form.html',
            success_url=reverse_lazy('model_files:book.list')),
        name='book.edit'),
    url(r'^books/delete/(?P<pk>\d+)/$',
        DeleteView.as_view(model=Book,
                           success_url=reverse_lazy('model_files:book.list')),
        name='book.delete'),
    url(r'^sound_devices/add/$',
        CreateView.as_view(
            model=SoundDevice,
            form_class=SoundDeviceForm,
            template_name='model_filefields_example/sound_device_form.html',
            success_url=reverse_lazy('model_files:book.list')),
        name='sound_device.add'),
]
コード例 #26
0
ファイル: urls.py プロジェクト: AaronMBrown/denigma
 url(r"^hierarchy/list/$", HierarchyList.as_view(), name="list-hierarchy"),
 ## Function-Views:
 url(r"^entries/$", "entries", name="entries"),
 url(r"^hierarchy/$", "hierarchy", name="hierarchy"),
 url(r"^entry/(?P<slug>.+)", "entry", name="data_entry"),  # Classic view.
 url(r"^entry/add", "add_entry", name="add_entry"),
 url(r"^entry/edit", "edit_entry", name="edit_view"),
 url(r"^entry/remove", "remove_entry", name="remove_entry"),
 url(
     r"^entry/breadcrump/(?P<slug>.+)", "breadcrump", name="breadcrump"
 ),  # An experimental view to display breadcrump.
 # Changes:
 ## Class-Views
 url(r"^changes/list/$", ChangeList.as_view(), name="list-changes"),
 url(r"^change/details/(?P<pk>\d+)", DetailView.as_view(model=Change), name="detail-change"),  # detail-change
 url(r"^change/delete/(?P<pk>\d+)", DeleteView.as_view(model=Change), name="delete-change"),
 ## Function-Views:
 url(r"^changes/(?P<pk>\d*)", "changes", name="changes"),
 url(r"^change/remove/(?P<slug>.+)/$", "remove_change", name="remove_change"),
 url(r"^change/feed/$", ChangeFeed(), name="data-change-feed"),
 url(r"^change/(?P<pk>\d*)/$", ChangeView.as_view(), name="change"),
 url(r"^change/(?P<slug>.+)/$", ChangeView.as_view(), name="change"),
 # Relations:
 ## Class-Views
 url(r"^relations/list", RelationList.as_view(), name="list-relations"),
 url(r"^relation/(?P<pk>\d+)", DetailView.as_view(model=Relation), name="relation-details"),
 url(r"^relation/create", RelationCreate.as_view(), name="create-relation"),
 url(r"^relation/update/(?P<pk>\d+)", login_required(RelationUpdate.as_view()), name="update-relation"),
 url(r"^relation/delete", login_required(DeleteView.as_view(model=Relation)), name="delete-relation"),
 ## Function-Views:
 url(r"^relations/$", "relations", name="relations"),
コード例 #27
0
from .views import EditJobCode, EditMachine, EditTimecard, JobCodeView, MachineView, TimecardView, JobCodeDelete, MachineDelete, JobCodeAdd, MachineAdd, TimecardAdd, TimecardAdd2
from .models import JobCode, Machine, Timecard
from django.views.generic.edit import DeleteView
from django.views.generic import TemplateView
from . import views

app_name = 'TimeClock'
urlpatterns = [
    path('jobcode/', JobCodeView.as_view(), name='Jobcode'),
    path('machine/', MachineView.as_view(), name='Machine'),
    path('timecard/', TimecardView.as_view(), name='Timecard'),
    path('edit/jobcode/<int:pk>', EditJobCode.as_view(), name='jobCodeEdit'),
    path('edit/machine/<int:pk>', EditMachine.as_view(), name='machineEdit'),
    path('edit/timecard/<int:pk>', EditTimecard.as_view(),
         name='timecardEdit'),
    path('delete/jobcode/<int:pk>',
         JobCodeDelete.as_view(),
         name='jobCodeDelete'),
    path('delete/machine/<int:pk>',
         MachineDelete.as_view(),
         name='machineDelete'),
    path('delete/timecard/<int:pk>',
         DeleteView.as_view(),
         name='timecardDelete'),
    path('add/jobcode/', JobCodeAdd.as_view(), name='jobCodeAdd'),
    path('add/machine/', MachineAdd.as_view(), name='machineAdd'),
    path('add/timecard/', TimecardAdd2.as_view(), name='timecardAdd'),
    #path('modelform/', views.modelformview, name='addmodalform'),
    #path('insert/', views.insert, name='insert'),
    path('register/', views.register, name='register')
]
コード例 #28
0
ファイル: views.py プロジェクト: pumpkinlink/auladjango
from contatos.core.forms import EmpresaForm
from contatos.core.models import CategoriaEmpresa, Empresa

CategoriaEmpresaForm = modelform_factory(CategoriaEmpresa)

index = TemplateView.as_view(template_name='index.html')

categoria_create = CreateView.as_view(
    model=CategoriaEmpresa,
    success_url=reverse_lazy('categoria_list'),
    form_class=CategoriaEmpresaForm
)
categoria_delete = DeleteView.as_view(
    template_name='confirm_delete.html',
    model=CategoriaEmpresa,
    success_url=reverse_lazy('categoria_list')
)
categoria_list = ListView.as_view(
    model=CategoriaEmpresa,
    paginate_by=15
)
categoria_update = UpdateView.as_view(
    model=CategoriaEmpresa,
    success_url=reverse_lazy('categoria_list')
)


empresa_create = CreateView.as_view(model=Empresa, success_url=reverse_lazy('empresa_list'), form_class=EmpresaForm)
empresa_delete = DeleteView.as_view(template_name='confirm_delete.html', model=Empresa, success_url=reverse_lazy('empresa_list'))
empresa_list = ListView.as_view(model=Empresa, paginate_by=15)
コード例 #29
0
def success(request):
    return render(request, 'shop/success.html')


# ----------------------------------------------- #

# [ CreateView, UpdateView, DeleteView ]

from django.views.generic.edit import CreateView, UpdateView, DeleteView

article_new = CreateView.as_view(model=Article, fields='__all__')

article_edit = UpdateView.as_view(model=Article, fields='__all__')

article_del = DeleteView.as_view(model=Article, success_url='/shop/')

# ----------------------------------------------- #


def template_test(request):
    article = Article.objects.get(id=1)
    myname = '성철'
    people = ['정표', '왕기', '아라']
    p = Person('정은')

    dt = timezone.now()
    str_dt = dt.strftime("%Y-%m-%d %H:%M:%S")
    past_dt = timezone.datetime(2018, 10, 22)
    future_dt = timezone.datetime(2019, 5, 21)
コード例 #30
0
ファイル: urls.py プロジェクト: bilougit/agenda
from django.views.generic.list import ListView
from django.core.urlresolvers import reverse_lazy

from views import (InvitationListView, InvitationCreateView,
    CircleCreateView, CircleListView, UserInfoUpdateView,
    ContactListView, ContactCreateView)
from models import Invitation, Contact, Circle, UserInfo


urlpatterns = patterns('',
    url(r'^invitation-list/$', InvitationListView.as_view(), name='invitation_list'),##
    url(r'^invitation-creation/$', InvitationCreateView.as_view(), name='invitation_create'),##
    url(r'^(?P<pk>\d+)/invitation/$', DetailView.as_view(model=Invitation), name='invitation_detail'),

    url(r'^contact/(?P<pk>\d+)/$', DetailView.as_view(model=Contact), name='contact_detail'),##
    url(r'contact/(?P<pk>\d+)/delete/$',
        DeleteView.as_view(model=Contact,
            success_url=reverse_lazy('contact_list')),
        name='contact_delete'),##
    url(r'^contact-list/$', ContactListView.as_view(), name='contact_list'),##
    url(r'^contact/(?P<pk>\d+)/update/$', UserInfoUpdateView.as_view(), name='contact_update'),##

    url(r'circle-list/$', CircleListView.as_view(model=Circle), name='circle_list'),#
    url(r'circle/(?P<pk>\d+)/$', DetailView.as_view(model=Circle), name='circle_detail'),##
    url(r'circle/(?P<pk>\d+)/delete/$',
      DeleteView.as_view(model=Circle,
        success_url=reverse_lazy('circle_list')),
      name='circle_delete'),
    url(r'circle/create/$', CircleCreateView.as_view(), name='circle_create'),##
    )
コード例 #31
0
ファイル: urls.py プロジェクト: thraxil/gearspotting
from django.conf.urls import url
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

from gearspotting.manufacturer.models import Manufacturer, ManufacturerForm
from gearspotting.manufacturer.views import (AddLinkView, AddGearView,
                                             EditLinksView)

urlpatterns = [
    url(r'^$', ListView.as_view(model=Manufacturer)),
    url(r'^create/?$',
        CreateView.as_view(model=Manufacturer, form_class=ManufacturerForm)),
    url(r'^(?P<slug>[^/]+)/update/?$',
        UpdateView.as_view(model=Manufacturer, form_class=ManufacturerForm)),
    url(r'^(?P<slug>[^/]+)/delete/?$', DeleteView.as_view(model=Manufacturer)),
    url(r'^(?P<slug>[^/]+)/edit_links/?$', EditLinksView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_gear/$', AddGearView.as_view()),
    url(r'^(?P<slug>[^/]+)/$', DetailView.as_view(model=Manufacturer)),
    url(r'^(?P<slug>[^/]+)/add_link/$', AddLinkView.as_view()),
]
コード例 #32
0
from . import views
from .models import Question

app_name = 'polls'
urlpatterns = [
    url(r'^$', views.IndexView.as_view(), name='index'),
    # url(r'^polls/question/$', views.QuestionView.as_view(), name='question'),
    url(r'^polls/question/$',
        CreateView.as_view(model=Question,
                           template_name='polls/question.html',
                           fields='__all__',
                           success_url=reverse_lazy('polls:index')),
        name='question'),
    url(r'^polls/question/(?P<pk>[0-9]+)/$',
        views.DetailView.as_view(),
        name='detail'),
    url(r'^polls/question/(?P<pk>[0-9]+)/edit/$',
        views.QuestionEditView.as_view(),
        name='update'),
    url(r'^polls/question/(?P<pk>[0-9]+)/delete/$',
        DeleteView.as_view(model=Question,
                           success_url=reverse_lazy('polls:index')),
        name='delete'),
    url(r'^polls/question/(?P<pk>[0-9]+)/results/$',
        views.ResultsView.as_view(),
        name='results'),
    url(r'^polls/question/(?P<question_id>[0-9]+)/vote',
        views.vote,
        name='vote'),
]
コード例 #33
0
        ListView.as_view(
            queryset=CD.objects.all(),
            template_name='model_filefields_example/cd_list.html'),
        name='cd.list'),
    url(r'^cds/add/$',
        CreateView.as_view(
            model=CD,
            form_class=CDForm,
            template_name='model_filefields_example/cd_form.html',
            success_url=reverse_lazy('model_files:cd.list')),
        name='cd.add'),
    url(r'^cds/edit/(?P<pk>\d+)/$',
        UpdateView.as_view(
            model=CD,
            form_class=CDForm,
            template_name='model_filefields_example/cd_form.html',
            success_url=reverse_lazy('model_files:cd.list')),
        name='cd.edit'),
    url(r'^cds/delete/(?P<pk>\d+)/$',
        DeleteView.as_view(model=CD,
                           success_url=reverse_lazy('model_files:cd.list')),
        name='cd.delete'),
    url(r'^sound_devices/add/$',
        CreateView.as_view(
            model=SoundDevice,
            form_class=SoundDeviceForm,
            template_name='model_filefields_example/sound_device_form.html',
            success_url=reverse_lazy('model_files:cd.list')),
        name='sound_device.add'),
]
コード例 #34
0
ファイル: views.py プロジェクト: srshin/django
# 자동으로 create하고나서 success인 경우 model의 get_absolute_url로 이동함.

#student_list = ListView.as_view(model =  Student, template_name="mainapp/student_all_list.html", paginate_by=10) # #object_list를 가지고 object_list.html로 render
student_detail = DetailView.as_view(
    model=Student, template_name="mainapp/student_view_detail.html"
)  #object를 가지고 object_detail.html로 render
student_new = CreateView.as_view(
    model=Student,
    template_name="mainapp/student_input_form.html",
    fields='__all__')  # object_form.html
student_edit = UpdateView.as_view(
    model=Student,
    template_name="mainapp/student_input_form.html",
    fields='__all__')  # object_form.html
student_delete = DeleteView.as_view(
    model=Student,
    template_name="mainapp/student_delete.html",
    success_url='/main/student/list')  # object_confirm_delete.html

#방법1 : Class에서 제공하는 default method를 이용하는 방법
#major_list = ListView.as_view(model =  Major, template_name="mainapp/major_all_list.html", paginate_by=10) # #object_list를 가지고 object_list.html로 render
major_detail = DetailView.as_view(
    model=Major, template_name="mainapp/major_view_detail.html"
)  #object를 가지고 object_detail.html로 render
major_new = CreateView.as_view(model=Major,
                               template_name="mainapp/major_input_form.html",
                               fields='__all__')  # object_form.html
major_edit = UpdateView.as_view(model=Major,
                                template_name="mainapp/major_input_form.html",
                                fields='__all__')  # object_form.html
major_delete = DeleteView.as_view(
    model=Major,
コード例 #35
0
from django.conf.urls import url
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

from gearspotting.gear.models import Gear
from gearspotting.gear.views import (GearTagView, IndexView, TagsView,
                                     AddLinkView, AddPhotoView, EditLinksView,
                                     EditPhotosView)

info_dict = {
    'queryset': Gear.objects.all(),
}

urlpatterns = [
    url(r'^$', IndexView.as_view()),
    url(r'^create/?$', CreateView.as_view(model=Gear)),
    url(r'^tag/(?P<tag>[^/]+)/$',
        GearTagView.as_view(),
        name='gear_tag_detail'),
    url(r'^tag/$', TagsView.as_view()),
    url(r'^(?P<slug>[^/]+)/update/?$', UpdateView.as_view(model=Gear)),
    url(r'^(?P<slug>[^/]+)/delete/?$', DeleteView.as_view(model=Gear)),
    url(r'^(?P<slug>[^/]+)/$', DetailView.as_view(slug_field='slug',
                                                  model=Gear)),
    url(r'^(?P<slug>[^/]+)/edit_links/?$', EditLinksView.as_view()),
    url(r'^(?P<slug>[^/]+)/edit_photos/?$', EditPhotosView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_link/$', AddLinkView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_photo/$', AddPhotoView.as_view()),
]
コード例 #36
0
ファイル: urls.py プロジェクト: pombredanne/denigma
    url(r'^entries/$', 'entries', name='entries'),
    url(r'^hierarchy/$', 'hierarchy', name='hierarchy'),
    url(r'^entry/(?P<slug>.+)', 'entry', name='data_entry'), # Classic view.
    url(r'^entry/add', 'add_entry', name='add_entry'),
    url(r'^entry/edit', 'edit_entry', name='edit_view'),
    url(r'^entry/remove', 'remove_entry', name='remove_entry'),
    url(r'^entry/breadcrump/(?P<slug>.+)', 'breadcrump', name='breadcrump'), # An experimental view to display breadcrump.

    # Changes:
    ## Class-Views
    url(r'^changes/list/$', ListView.as_view(
            queryset=Change.objects.filter(of__published=True).order_by('-at'),
            paginate_by=30),
        name='list-changes'),
    url(r'^change/details/(?P<pk>\d+)', DetailView.as_view(model=Change), name='detail-change'), #detail-change
    url(r'^change/delete/(?P<pk>\d+)', DeleteView.as_view(model=Change), name='delete-change'),
    ## Function-Views:
    url(r'^changes/(?P<pk>\d*)', 'changes', name='changes'),
    url(r'^change/remove/(?P<slug>.+)/$', 'remove_change', name='remove_change'),
    url(r'^change/(?P<slug>.+)/$', 'change', name='change'),


    # Relations:
    ## Class-Views
    url(r'^relations/list', ListView.as_view(queryset=Relation.objects.all()), name='list-relations'),
    url(r'^relation/(?P<pk>\d+)', DetailView.as_view(model=Relation), name='relation-details'),
    url(r'^relation/create', RelationCreate.as_view(), name='create-relation'),
    url(r'^relation/update/(?P<pk>\d+)', login_required(RelationUpdate.as_view()), name='update-relation'),
    url(r'^relation/delete', login_required(DeleteView.as_view(model=Relation)), name='delete-relation'),
    ## Function-Views:
    url(r'^relations/$', 'relations', name='relations'),
コード例 #37
0
        login_required(CreateView.as_view(form_class=VendorForm, )),
        name="vendor-signup",
    ),  # Signup as a new vendor
    url(
        r'^(?P<slug>[-\w]+)/edit/$',
        login_required(
            UpdateView.as_view(
                model=Vendor,
                form_class=VendorForm,
                slug_field='slug',
            )),
        name="vendor-edit",
    ),  # Edit your vendor profile
    url(
        r'^(?P<slug>[-\w]+)/delete/$',
        login_required(DeleteView.as_view(model=Vendor, )),
        name="vendor-delete",
    ),  # Delete your vendor profile

    # Having to do with applications for vendors
    #url(r'^(?P<slug>[-\w]+)/applications/$',
    #    login_required(VendorApplicationList.as_view(
    #        name="vendor-application-list",
    #    ))),
    url(
        r'^(?P<slug>[-\w]+)/applications/create/$',
        login_required(CreateView.as_view(form_class=ApplicationForm)),
        name="vendor-application-create",
    ),
    #url(r'^(?P<slug>[-\w]+)/applications/(?P<year>\d{4})/$',
    #    login_required(VendorApplicationDetail.as_view(
コード例 #38
0
ファイル: urls.py プロジェクト: suqingdong/pythonanywhere
from .models import Post


from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy


app_name = 'blog'

urlpatterns = [

    # /blog/
    url(r'^$', ListView.as_view(model=Post), name='index'),

    # /blog/2/
    url(r'^(?P<pk>\d+)/$', DetailView.as_view(model=Post), name='detail'),

    # /blog/add/
    url(r'^add/$', CreateView.as_view(model=Post, fields="__all__"), name='add-blog'),

    # /blog/2/update/
    url(r'^(?P<pk>\d+)/update/$', UpdateView.as_view(model=Post,
                                                     fields="__all__"), name='update-blog'),

    # /blog/2/delete/
    url(r'^(?P<pk>\d+)/delete/$', DeleteView.as_view(model=Post,
                                                     success_url=reverse_lazy('blog:index')), name='delete-blog')

]
コード例 #39
0
ファイル: urls.py プロジェクト: CPSC473Team4/corrupted_half
urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'corrupted_half.views.home', name='home'),
    url(r'^$', 'reviews.views.home'),
	url(r'^home/', 'reviews.views.home'),
	# url(r'^auth/(?P<action>\w+)', 'reviews.views.auth'),
	url(r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'reviews/auth/login.html'}),
	url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
	url(r'^accounts/user/$', 'reviews.views.user', {}, name='view_user'),
    url(r'^accounts/user/add/$', RegisterUser.as_view(), {}, name='register_user'),
	url(r'^accounts/add/$', CreateView.as_view(model=User, form_class=UserCreateForm), name='user_add'),

    url(r'^search/.*$', SearchView.as_view(), name='search'),

	url(r'^businesses/$', BusinessListView.as_view()),
    url(r'^businesses/(?P<pk>\d+)/$', BusinessDetail.as_view(), name='business_detail'),
    url(r'^businesses/add/$', login_required(BusinessCreate.as_view()), name='business_add'),
    url(r'^businesses/(?P<pk>\d+)/edit/$', permission_required('business.can_update')(BusinessUpdate.as_view(model=Business, form_class=BusinessForm)), name='business_update'),
    url(r'^businesses/(?P<pk>\d+)/delete/$', permission_required('business.can_delete')(DeleteView.as_view(model=Business)), name='business_delete'),

    url(r'^businesses/(?P<pk>\d+)/reviews/add/$', login_required(ReviewCreate.as_view()), name='review_add'),

    (r'^media/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT }),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)
コード例 #40
0
from django.conf.urls.defaults import *
from django.views.generic.edit import CreateView, DeleteView
from tinygraph.apps.definitions.models import Package
from tinygraph.apps.definitions.forms import PackageForm

urlpatterns = patterns(
    'definitions.views',
    url(r'^mibs/$', 'mib_upload_list', name='mib_upload_list'),
    url(r'^packages/$', 'package_list', name='package_list'),
    url(r'^packages/add/$',
        CreateView.as_view(
            model=Package,
            template_name='definitions/packages/package_form.html',
            form_class=PackageForm,
        ),
        name='package_add'),
    url(r'^packages/(?P<package_slug>[-\w]+)/$',
        'package_detail',
        name='package_detail'),
    url(r'^packages/(?P<slug>[-\w]+)/delete$',
        DeleteView.as_view(
            model=Package,
            template_name='definitions/packages/package_delete.html',
            success_url='/data/packages/',
        ),
        name='package_delete'),
    url(r'^$', 'data_object_list', name='data_object_list'),
)
コード例 #41
0
        name='book.add'
    ),
    url(
        r'^books/edit/(?P<pk>\d+)/$',
        UpdateView.as_view(
            model=Book,
            form_class=BookForm,
            template_name='model_filefields_example/book_form.html',
            success_url=reverse_lazy('model_files:book.list')
        ),
        name='book.edit'
    ),
    url(
        r'^books/delete/(?P<pk>\d+)/$',
        DeleteView.as_view(
            model=Book,
            success_url=reverse_lazy('model_files:book.list')
        ),
        name='book.delete'
    ),
    url(
        r'^sound_devices/add/$',
        CreateView.as_view(
            model=SoundDevice,
            form_class=SoundDeviceForm,
            template_name='model_filefields_example/sound_device_form.html',
            success_url=reverse_lazy('model_files:book.list')
        ),
        name='sound_device.add'
    ),
]
コード例 #42
0
ファイル: urls.py プロジェクト: thraxil/gearspotting
from django.conf.urls import url
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView, UpdateView, DeleteView

from gearspotting.musician.models import Musician, MusicianForm
from gearspotting.musician.views import (MusicianTagView, TagsView,
                                         AddLinkView, AddPhotoView,
                                         AddGearView, EditLinksView,
                                         EditPhotosView, EditGearView)

urlpatterns = [
    url(r'^$', ListView.as_view(model=Musician)),
    url(r'^create/?$',
        CreateView.as_view(form_class=MusicianForm, model=Musician)),
    url(r'^(?P<slug>[^/]+)/update/?$',
        UpdateView.as_view(form_class=MusicianForm, model=Musician)),
    url(r'^(?P<slug>[^/]+)/delete/?$', DeleteView.as_view(model=Musician)),
    url(r'^tag/(?P<tag>[^/]+)/$',
        MusicianTagView.as_view(),
        name='musician_tag_detail'),
    url(r'^tag/$', TagsView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_link/$', AddLinkView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_photo/$', AddPhotoView.as_view()),
    url(r'^(?P<slug>[^/]+)/add_gear/$', AddGearView.as_view()),
    url(r'^(?P<slug>[^/]+)/edit_links/?$', EditLinksView.as_view()),
    url(r'^(?P<slug>[^/]+)/edit_photos/?$', EditPhotosView.as_view()),
    url(r'^(?P<slug>[^/]+)/edit_gear/?$', EditGearView.as_view()),
    url(r'^(?P<slug>[^/]+)/$', DetailView.as_view(model=Musician)),
]
コード例 #43
0
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView

from hardware.models import Computer
from hardware.views import ComputerDetailView

urlpatterns = patterns(
    '',

    ###################################
    # Computers
    (r'^computers/$', ListView.as_view(model=Computer)),
    (
        r'^computers/create/$',
        CreateView.as_view(model=Computer, ),
    ),
    (
        r'^computers/(?P<pk>\d+)/$',
        ComputerDetailView.as_view(model=Computer, ),
    ),
    (
        r'^computers/(?P<pk>\d+)/update/$',
        UpdateView.as_view(model=Computer, ),
    ),
    (
        r'^computers/(?P<pk>\d+)/delete/$',
        DeleteView.as_view(model=Computer, ),
    ),
    ###################################
)
コード例 #44
0
ファイル: urls.py プロジェクト: JohnWilson12345/geoevents
                           MonthArchiveView.as_view(queryset=Event.objects.all(),
                                                    date_field='created',
                                                    template_name='incident-archive-month.html',
                                                    month_format='%m'), name='operations-view-incident-archive-month'),

                       url(r'^incidents/archives/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
                           DayArchiveView.as_view(queryset=Event.objects.all(),
                                                  date_field='created',
                                                  template_name='incident-archive-day.html',
                                                  month_format='%m',
                           ), name='operations-view-incident-archive-day'),

                       url(r'^incidents/delete/(?P<pk>\d+)/$',
                           permission_required('operations.delete_event', reverse_lazy('home'))(
                               DeleteView.as_view(model=Event,
                                                  template_name='generic-delete.html',
                                                  success_url=reverse_lazy('active-incidents'))),
                           name='operations-delete-incident-pk'),

                       url(r'^incidents/kml/(?P<pk>\d+)/$', KMLReponse.as_view(queryset=Event.objects.all(),
                                                                               template_name='incidents.kml',
                                                                               context_object_name='incident'),
                           name='operations-view-incident-kml'),

                       url(r'^deployments/manage/$',
                           permission_required('operations.add_deployment', reverse_lazy('home'))(
                               NewDeploymentFromIncident.as_view(form_class=NewDeploymentForm,
                                                                 template_name='generic_form_page.html')),
                           name='operations-manage-deployment'),
                       url(r'^deployments/manage/(?P<pk>\d+)/$',
                           permission_required('operations.change_deployment', reverse_lazy('home'))(
コード例 #45
0
ファイル: urls.py プロジェクト: jimfmunro/django-starter
    url(r'^admin/', include(admin.site.urls)),
)

# model form tests
urlpatterns += patterns('',
    url(r'^starter/$', ListView.as_view(model=Starter), name="list_page"),
    url(r'^starter/create/$', CreateView.as_view(
            model=Starter,
            success_url=reverse_lazy('list_page')), 
        name="create_page"),
    url(r'^starter/(?P<pk>\d+)/update/$', UpdateView.as_view(
            model=Starter, 
            success_url=reverse_lazy('list_page')),
        name="update_page"),
    url(r'^starter/(?P<pk>\d+)/delete/$', DeleteView.as_view(
            model=Starter, 
            success_url = reverse_lazy('list_page'),
            template_name_suffix="_confirm_delete"),
        name="delete_page"),
    url(r'^starter/(?P<pk>\d+)/$', DetailView.as_view(model=Starter), name="detail_page"),
    )

###################################
## development and test settings ##
###################################

if settings.DEBUG:
    #development site property directories
    
    static_dir = os.path.join(
        os.path.dirname(__file__), '../static'
    )
コード例 #46
0
ファイル: urls.py プロジェクト: nikolas/rolf

site_media_root = os.path.join(os.path.dirname(__file__), "../media")

accounts_tuple = (r'^accounts/', include('django.contrib.auth.urls'))

urlpatterns = patterns(
    '',
    (r'^$', 'rolf.rolf_main.views.index'),
    (r'^category/add/', 'rolf.rolf_main.views.add_category'),
    (r'^category/(?P<object_id>\d+)/$',
     'rolf.rolf_main.views.generic_detail', category_info_dict),
    (r'^category/(?P<object_id>\d+)/add_application/$',
     'rolf.rolf_main.views.add_application'),
    (r'^category/(?P<pk>\d+)/delete/$',
     DeleteView.as_view(model=Category, success_url="/")),

    (r'^application/(?P<object_id>\d+)/$',
     'rolf.rolf_main.views.generic_detail', application_info_dict),
    (r'^application/(?P<object_id>\d+)/add_deployment/$',
     'rolf.rolf_main.views.add_deployment'),
    (r'^application/(?P<pk>\d+)/delete/$',
     DeleteView.as_view(model=Application, success_url="/")),

    (r'^deployment/(?P<object_id>\d+)/$',
     'rolf.rolf_main.views.generic_detail', deployment_info_dict),
    (r'^deployment/(?P<object_id>\d+)/add_setting/$',
     'rolf.rolf_main.views.add_setting'),
    (r'^deployment/(?P<object_id>\d+)/edit_settings/$',
     'rolf.rolf_main.views.edit_settings'),
    (r'^deployment/(?P<object_id>\d+)/add_stage/$',
コード例 #47
0
ファイル: urls.py プロジェクト: tomusher/Diffuse
    # Plans
    url(r'^$',
                        PlanListView.as_view(),
                        name="plan_list"),
    url(r'^plans/$',    
                        PlanListView.as_view(), 
                        name="plan_list"),
    url(r'^plans/create/$',  
                        CreateView.as_view(model=Plan), 
                        name="plan_add"),
    url(r'^plans/edit/(?P<pk>\d+)$', 
                        UpdateView.as_view(model=Plan),
                        name="plan_edit"),
    url(r'^plans/delete/(?P<pk>\d+)$', 
                        DeleteView.as_view(model=Plan,
                                           success_url="/plans/"), 
                        name="plan_delete"),
    url(r'^plans/star/(?P<pk>\d+)$', 
                        'motes.views.plan_star',
                        name="plan_star"),
    url(r'^plans/(?P<plan_id>\d+)$', 
                        'motes.views.plan_view', 
                        name='plan_view'),
    url(r'^plans/(?P<plan_id>\d+)/edit/(?P<mote_id>\d+)$',
                        'motes.views.mote_edit',
                        name='mote_edit'),
    url(r'^plans/(?P<plan_id>\d+)/delete/(?P<pk>\d+)$',
                        DeleteView.as_view(model=Mote,
                                           template_name="motes/mote_confirm_delete.html",
                                           success_url="/plans/"),
                        name='mote_delete'),
コード例 #48
0
ファイル: urls.py プロジェクト: suqingdong/Sources
    # /music/2/
    url(r'^(?P<pk>\d+)/$', DetailView.as_view(model=Album,
                                              template_name='music/detail.html'), name='detail'),

    # /music/alubm/add/
    url(r'^album/add/$', CreateView.as_view(model=Album,
                                            fields="__all__"), name="album-add"),

    # /music/alubm/3/update/
    url(r'^album/(?P<pk>\d+)/update/$',
        UpdateView.as_view(model=Album, fields="__all__"), name="album-update"),

    # /music/alubm/3/delete/
    url(r'^album/(?P<pk>\d+)/delete/$',
        DeleteView.as_view(model=Album, success_url=reverse_lazy('music:index')), name="album-delete"),

    # Song Part
    # /music/songs/
    url(r'^songs/$', ListView.as_view(model=Song,
                                      context_object_name="songs"), name="songs"),

    # /music/songs/add/
    url(r'^songs/add/$', CreateView.as_view(model=Song,
                                            fields="__all__"), name='song-add'),

    # /music/songs/2/update/
    url(r'^songs/(?P<pk>\d+)/update/$', UpdateView.as_view(model=Song,
                                                           fields="__all__"), name="song-update"),

    # /music/songs/2/delete/
コード例 #49
0
    #             template_name='usrs/file_list.html'
    #         ),
    #         name='your_page'
    #     ),
    # url(
    #     r'^add/$',
    #     CreateView.as_view(
    #         model=Book,
    #         form_class=BookForm,
    #         template_name='usrs/file_add.html',
    #         success_url=reverse_lazy('model_files:your_page')
    #     ),
    #     name='book.add'
    # ),
    url(r'^add/$', views.file_add, name='book.add'),
    url(r'^edit/(?P<pk>\d+)/$',
        UpdateView.as_view(model=Book,
                           form_class=BookForm,
                           template_name='usrs/file_add.html',
                           success_url=reverse_lazy('model_files:your_page')),
        name='book.edit'),
    url(r'^delete/(?P<pk>\d+)/$',
        DeleteView.as_view(model=Book,
                           success_url=reverse_lazy('model_files:your_page')),
        name='book.delete'),
]

# url(r'^add/$', views.file_add, name='book.add'),

# url(r'^$', views.home, name='home'),
コード例 #50
0
ファイル: urls.py プロジェクト: ccnmtl/rolf
}

recipe_info_dict = {
    'model': Recipe,
    'template_name': 'rolf/recipe_detail.html',
}


accounts_tuple = url(r'^accounts/', include('django.contrib.auth.urls'))

urlpatterns = [
    url(r'^$', index),
    url(r'^category/add/', add_category),
    url(r'^category/(?P<object_id>\d+)/$', generic_detail, category_info_dict),
    url(r'^category/(?P<object_id>\d+)/add_application/$', add_application),
    url(r'^category/(?P<pk>\d+)/delete/$', DeleteView.as_view(
        model=Category, success_url="/")),

    url(r'^application/(?P<object_id>\d+)/$', generic_detail,
        application_info_dict),
    url(r'^application/(?P<object_id>\d+)/add_deployment/$', add_deployment),
    url(r'^application/(?P<pk>\d+)/delete/$', DeleteView.as_view(
        model=Application, success_url="/")),

    url(r'^deployment/(?P<object_id>\d+)/$', generic_detail,
        deployment_info_dict, name='deployment_detail'),
    url(r'^deployment/(?P<object_id>\d+)/add_setting/$', add_setting),
    url(r'^deployment/(?P<object_id>\d+)/edit_settings/$', edit_settings),
    url(r'^deployment/(?P<object_id>\d+)/add_stage/$', add_stage),
    url(r'^deployment/(?P<object_id>\d+)/clone/$', clone_deployment),
    url(r'^deployment/(?P<object_id>\d+)/push/$', push),
    url(r'^deployment/(?P<object_id>\d+)/remove_permission/$',
コード例 #51
0
ファイル: urls.py プロジェクト: Etxea/gestion_eide_web
from django.conf.urls import patterns, include, url
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.auth.decorators import login_required, permission_required

from models import Cliente
from views import *

urlpatterns = patterns('',
    url(r'^$', login_required(ListView.as_view(model=Cliente)),name="cliente_lista"),
    url(r'nuevo$',ClienteCreateView.as_view(), name="cliente_nuevo"),
    url(r'editar/(?P<pk>\d+)/$',ClienteUpdateView.as_view(), name="cliente_editar"),
    url(r'borrar/(?P<pk>\d+)/$',login_required(DeleteView.as_view(model=Cliente,success_url="/clientes/")), name="cliente_borrar"),
    url(r'contactos/(?P<cliente_id>\d+)/add/$',ClienteContactoCreateView.as_view(), name="cliente_contacto_add"),
    url(r'contactos/(?P<pk>\d+)/del/$',ClienteContactoDeleteView.as_view(), name="cliente_contacto_del"),
    url(r'ver/(?P<pk>\d+)/$',ClienteDetailView.as_view(), name="cliente_detalle"),
)
コード例 #52
0
ファイル: urls.py プロジェクト: powellc/django-vendors
            name="vendor-detail",
        ),
    url(r'^signup/$', 
        login_required(CreateView.as_view(
            form_class=VendorForm,)),
            name="vendor-signup",
        ), # Signup as a new vendor
    url(r'^(?P<slug>[-\w]+)/edit/$', 
        login_required(UpdateView.as_view(
            model=Vendor,
            form_class=VendorForm, 
            slug_field='slug', )),
            name="vendor-edit",
        ), # Edit your vendor profile
    url(r'^(?P<slug>[-\w]+)/delete/$', 
        login_required(DeleteView.as_view(
            model=Vendor, )),
            name="vendor-delete",
       ), # Delete your vendor profile

    # Having to do with applications for vendors
    #url(r'^(?P<slug>[-\w]+)/applications/$', 
    #    login_required(VendorApplicationList.as_view(
    #        name="vendor-application-list",
    #    ))),
    url(r'^(?P<slug>[-\w]+)/applications/create/$', 
        login_required(CreateView.as_view(
            form_class=ApplicationForm)),
            name="vendor-application-create",
        ),
    #url(r'^(?P<slug>[-\w]+)/applications/(?P<year>\d{4})/$', 
    #    login_required(VendorApplicationDetail.as_view(
コード例 #53
0
ファイル: urls.py プロジェクト: wooyek/db_file_storage
        name='cd.add'
    ),
    url(
        r'^cds/edit/(?P<pk>\d+)/$',
        UpdateView.as_view(
            model=CD,
            form_class=CDForm,
            template_name='model_filefields_example/cd_form.html',
            success_url=reverse_lazy('model_files:cd.list')
        ),
        name='cd.edit'
    ),
    url(
        r'^cds/delete/(?P<pk>\d+)/$',
        DeleteView.as_view(
            model=CD,
            success_url=reverse_lazy('model_files:cd.list')
        ),
        name='cd.delete'
    ),
    url(
        r'^sound_devices/add/$',
        CreateView.as_view(
            model=SoundDevice,
            form_class=SoundDeviceForm,
            template_name='model_filefields_example/sound_device_form.html',
            success_url=reverse_lazy('model_files:cd.list')
        ),
        name='sound_device.add'
    ),
]
コード例 #54
0
ファイル: views.py プロジェクト: zokis/TODO-agenda
class EventoDeleteView(DeleteView):
    def get(self, request, *args, **kwargs):
        self.object = self.get_object()
        if self.object.owner != request.user:
            raise Http404

        context = self.get_context_data(object=self.object)
        return self.render_to_response(context)

    def delete(self, request, *args, **kwargs):
        if self.object.owner != request.user:
            raise Http404
        self.object = self.get_object()
        self.object.delete()
        return HttpResponseRedirect(self.get_success_url())


evento_delete = user_passes_test(
    lambda u: u.is_superuser)(DeleteView.as_view(model=CalendarioEvento, template_name='confirm_delete.html', success_url=reverse_lazy('meus_eventos')))


departamento_create = user_passes_test(
    lambda u: u.is_superuser)(CreateView.as_view(form_class=DepartamentoForm, model=Departamento, success_url=reverse_lazy('departamento_list')))
departamento_delete = user_passes_test(
    lambda u: u.is_superuser)(DeleteView.as_view(model=Departamento, template_name='confirm_delete.html', success_url=reverse_lazy('departamento_list')))
departamento_list = user_passes_test(
    lambda u: u.is_superuser)(ListView.as_view(queryset=Departamento.objects.all(), paginate_by=10))
departamento_update = user_passes_test(
    lambda u: u.is_superuser)(UpdateView.as_view(form_class=DepartamentoForm, model=Departamento, success_url=reverse_lazy('departamento_list')))
コード例 #55
0
ファイル: urls.py プロジェクト: theseusyang/geoevents
                              date_field='created',
                              template_name='incident-archive-month.html',
                              month_format='%m'),
     name='operations-view-incident-archive-month'),
 url(r'^incidents/archives/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/$',
     DayArchiveView.as_view(
         queryset=Event.objects.all(),
         date_field='created',
         template_name='incident-archive-day.html',
         month_format='%m',
     ),
     name='operations-view-incident-archive-day'),
 url(r'^incidents/delete/(?P<pk>\d+)/$',
     permission_required('operations.delete_event', reverse_lazy('home'))(
         DeleteView.as_view(model=Event,
                            template_name='generic-delete.html',
                            success_url=reverse_lazy('active-incidents'))),
     name='operations-delete-incident-pk'),
 url(r'^incidents/kml/(?P<pk>\d+)/$',
     KMLReponse.as_view(queryset=Event.objects.all(),
                        template_name='incidents.kml',
                        context_object_name='incident'),
     name='operations-view-incident-kml'),
 url(r'^deployments/manage/$',
     permission_required('operations.add_deployment', reverse_lazy('home'))(
         NewDeploymentFromIncident.as_view(
             form_class=NewDeploymentForm,
             template_name='generic_form_page.html')),
     name='operations-manage-deployment'),
 url(r'^deployments/manage/(?P<pk>\d+)/$',
     permission_required('operations.change_deployment',
コード例 #56
0
from django.conf.urls import patterns, url
from django.views.generic import ListView
from sms_controll import views
from sms_controll.models import Kierowca
from sms_controll.views import KierowcyList, EdytujKierowce
from django.views.generic.edit import DeleteView

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^loguj/$', views.loguj, name='loguj'),
    url(r'^home/$', views.home, name='home'),
    url(r'^home/sms_list$', views.sms_list, name='sms_list'),
    #url(r'^home/kierowca$', views.kierowca_new, name='kierowca_new'),
    url(r'^home/kierowca', views.UtworzKierowce.as_view()),
    url(r'^home/edytuj/(?P<pk>\d+)/', views.EdytujKierowce.as_view(), name = 'edytuj'),
    url(r'^home/usun/(?P<pk>\d+)/', DeleteView.as_view(model=Kierowca, template_name = 'sms_controll/kierowca_usun.html', success_url = '/home/kierowcy'), name = 'usun'),
    #url(r'^home/kierowcy$', ListView.as_view(model = Kierowca, context_object_name = 'kierowca'), name='kierowca_list'),
    url(r'^home/kierowcy/', KierowcyList.as_view()),
    url(r'^wyloguj/$', views.wyloguj, name='wyloguj'),
    #url(r'^logout/$', 'django.contrib.auth.views.logout',{'next page': 'index',}, name='logout'),
]
コード例 #57
0
ファイル: urls.py プロジェクト: by-cx/MoneyMaker
from django.contrib.auth.decorators import login_required

urlpatterns = patterns('',
    url(r"^category/$", login_required(ListView.as_view(
        model=Category,
        template_name="list_category.html"
    )), name="category"),
    url(r"^category/add/$", login_required(CreateView.as_view(
        model=Category,
        template_name="form_category.html",
        form_class=CategoryForm,
        success_url="/category/",
    )), name="category_add"),
    url(r"^category/rm/(?P<pk>\d+)/$", login_required(DeleteView.as_view(
        queryset=Category.objects.order_by("name"),
        template_name="confirm_category.html",
        success_url="/category/",
    )), name="category_remove"),
    url(r"^category/update/(?P<pk>\d+)/$", login_required(UpdateView.as_view(
        model=Category,
        template_name="form_category.html",
        form_class=CategoryForm,
        success_url="/category/",
    )), name="category_update"),
    url(r"^bill/add/$", login_required(BillCreateView.as_view(
        template_name="form_bill.html",
        form_class=BillForm,
        success_url="/",
    )), name="bill_add"),
    url(r"^bill/rm/(?P<pk>\d+)/$", login_required(DeleteView.as_view(
        model=Bill,
コード例 #58
0
ファイル: views_cbv.py プロジェクト: jkanu3042/vod-python
from django import forms
from django.views.generic import CreateView, ListView, DetailView, UpdateView
from django.views.generic.edit import DeleteView
from django.core.urlresolvers import reverse, reverse_lazy

from .models import Post


post_list = ListView.as_view(model=Post, paginate_by=3)
post_detail = DetailView.as_view(model=Post)

# success_url이 기입되지 않으면, Post Model에 정의된 get_absolute_url()이 자동으로 호출된다.
post_new = CreateView.as_view(model=Post)
post_edit = UpdateView.as_view(model=Post, fields='__all__')
post_delete = DeleteView.as_view(model=Post, success_url=reverse_lazy('blog:post_list'))