Beispiel #1
0
def item_metadata(request, item_id):
    return UpdateView.as_view(request,
        form_class = ItemMetadataForm,
        object_id = item_id,
        template_name = "spindle/item_metadata.html",
        template_object_name = "item",
        post_save_redirect = reverse(item_metadata, kwargs={'item_id': item_id}))
Beispiel #2
0
from django.shortcuts import resolve_url as r
from django.views.generic import CreateView, ListView, DetailView
from django.views.generic.edit import UpdateView
from orcamentos.crm.models import Person, Customer
from orcamentos.crm.forms import PersonForm, CustomerForm

# FirstnameSearchMixin
person_list = ListView.as_view(model=Person, paginate_by=10)

person_detail = DetailView.as_view(model=Person)

# LoginRequiredMixin
person_create = CreateView.as_view(model=Person, form_class=PersonForm)

# LoginRequiredMixin
person_update = UpdateView.as_view(model=Person, form_class=PersonForm)

customer_list = ListView.as_view(model=Customer, paginate_by=10)

customer_detail = DetailView.as_view(model=Customer)

# LoginRequiredMixin
customer_create = CreateView.as_view(model=Customer, form_class=CustomerForm)

# LoginRequiredMixin
customer_update = UpdateView.as_view(model=Customer, form_class=CustomerForm)
Beispiel #3
0
urlpatterns = patterns('',
                       url(r'^$', ListView.as_view(queryset=Note.objects.filter(public=1),
                                                   template_name='note-list.html',
                                                   paginate_by=25,
                       ), name='notes-view-notes'),

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

                       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',
                       ),
Beispiel #4
0
    url(r'^api/list/(?P<pk>[0-9]+)/official/$',
        permission_required('student.view_studentofficialdetails',
                            login_url='core:not_found')(
                                OfficialDetailsListAPIView.as_view()),
        name='api-list-official'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        permission_required('student.change_student',
                            login_url='core:not_found')(
                                UpdateAPIView.as_view()),
        name='api-update'),
    url(r'^api/update/official/(?P<pk>[0-9]+)/$',
        permission_required('student.change_studentofficialdetails',
                            login_url='core:not_found')(
                                UpdateOfficialDetailsAPIView.as_view()),
        name='api-update-official'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        permission_required('student.change_student',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="student/form.html",
                                model=Table,
                                fields=['id', 'first_name', 'last_name'])),
        name='update'),
    url(r'^update/view/(?P<pk>[0-9]+)/$',
        permission_required('student.change_student',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="student/view.html",
                                model=Table,
                                fields=['id', 'first_name', 'last_name'])),
        name='update-view'),
]
        name='api-list-all-stock'),
    url(r'^api/list/stock/(?P<pk>[0-9]+)/$',
        ListStockAPIView.as_view(),
        name='api-list-stock'),
    url(r'^api/list/category/(?P<pk>[0-9]+)/$',
        ListCategoryAPIView.as_view(),
        name='api-list-category'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^api/update/item/(?P<pk>[0-9]+)/$',
        UpdateItemAPIView.as_view(),
        name='api-update-item'),
    url(r'^add/$',
        TemplateView.as_view(template_name=module + "/form.html"),
        name='add'),
    url(r'^report/$',
        TemplateView.as_view(template_name=module + "/list_report.html"),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name=module + "/items.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update'),
    url(r'^update/view/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name=module + "/item_view.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update-view'),
]
Beispiel #6
0
                           'geoevents.director.views.ReportLink', name='reports-linkage'),
                       url(r'^report/$', ListView.as_view(queryset=Report.objects.filter(public=1),
                                                          template_name='report-list.html',
                                                          paginate_by=25,
                       ), name='reports-view-reports'),
                       url(r'^report/(?P<pk>\d+)/$', DetailView.as_view(queryset=Report.objects.all(),
                                                                        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', ),
Beispiel #7
0
from .api.views import *
from .models import Subject as Table

urlpatterns = [
    url(r'^$',
        permission_required('subject.view_subject',
                            login_url='core:not_found')(TemplateView.as_view(
                                template_name="subject/list.html")),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        permission_required('subject.add_subject', login_url='core:not_found')(
            TemplateView.as_view(template_name="subject/form.html")),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        permission_required('subject.change_subject',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="subject/form.html",
                                model=Table,
                                fields=['id', 'name'])),
        name='update'),
]
Beispiel #8
0
                         paginate_by=10),
        name='posts'),
        
    url(r'^posts/new/$', 
        staff_member_required(CreateView.as_view(
                model=Post, 
                template_name='posts/new.html')),
        name='new_post'),
            
    url(r'^post/(?P<pk>\d+)/$',
        DetailView.as_view(model=Post, template_name='posts/show.html'),
        name='post'),
            
    url(r'^post/(?P<pk>\d+)/edit/$', 
        staff_member_required(UpdateView.as_view(
                model=Post, 
                template_name='posts/edit.html')),
        name='edit_post'),            
    
    
    # URLs as specified by the project instructions.
    url(r'^(?P<slug>[^/]+)/$', 
        DetailView.as_view(model=Post, template_name='posts/show.html'),
        name='post_by_slug'),
)


# Feed URLs.
urlpatterns += patterns('',
    url(r'^posts/recent/rss/$', RecentPostsFeed(), name='recent_posts_feed'),
    url(r'^posts/rss/$', AllPostsFeed(), name='all_posts_feed'),
Beispiel #9
0
    # Album Part
    # /music/
    url(r'^$', ListView.as_view(model=Album, template_name='music/index.html',
                                context_object_name='album_list'), name='index'),

    # /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/
Beispiel #10
0
        {'document_root':'../media'}),

    url(r'^tinymce/', include('tinymce.urls')),

    # 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+)$',
Beispiel #11
0
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 *
from views import *
from forms import *

urlpatterns = patterns('',
    url(r'^$', CursosListView.as_view(),name="cursos_lista"),
    url(r'calendario/(?P<curso_id>\d+)/(?P<ano>\d+)/(?P<mes>\d+)/$',login_required(calendario_mes), name="curso_calendario_mes"),
    url(r'nuevo/$',login_required(CreateView.as_view(model=Curso,form_class = CursoForm)), name="curso_nuevo"),
    url(r'clases/(?P<cliente_id>\d+)/nueva/$',login_required(CreateView.as_view(model=Clase)), name="clase_curso_nueva"),
    url(r'clases/nueva$',login_required(CreateView.as_view(model=Clase)), name="clase_nueva"),
    url(r'clases/(?P<pk>\d+)/editar/$',login_required(UpdateView.as_view(model=Clase)), name="clase_editar"),
    url(r'clases/(?P<pk>\d+)/borrar/$',ClaseDeleteView.as_view(), name="clase_borrar"),
    url(r'(?P<pk>\d+)/$',CursoDetailView.as_view(), name="curso_detalle"),
    url(r'(?P<pk>\d+)/borrar/$',CursoDeleteView.as_view(), name="curso_borrar"),
    url(r'(?P<pk>\d+)/editar/$',login_required(UpdateView.as_view(model=Curso)), name="curso_editar"),
)
Beispiel #12
0
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)
empresa_update = UpdateView.as_view(model=Empresa, success_url=reverse_lazy('empresa_list'), form_class=EmpresaForm)
Beispiel #13
0
# coding=utf-8
from django.conf.urls import patterns, url
from django.views.generic.edit import UpdateView, CreateView
from apps.travel.models import TravelReview

__author__ = 'alexy'


urlpatterns = patterns(
    'apps.travel.views',
    url(r'^review/(?P<slug>[\w-]+)$', 'travel_detail', name='detail'),
    url(r'^review-change/(?P<slug>[\w-]+)$', UpdateView.as_view(model=TravelReview, template_name='travel/travel_change.html'), name='change'),
    url(r'^review-add/$', CreateView.as_view(model=TravelReview, template_name='travel/travel_add.html'), name='add'),
    url(r'^', 'travel_list', name='list'),
)
Beispiel #14
0
class EntryList(EntryMixin, ListView):
    model = Entry
    paginate_by = 10


def entry_detail_json(request, pk):
    data = Entry.objects.filter(pk=pk)
    s = serializers.serialize("json", data)
    return HttpResponse(s)


entry_detail = DetailView.as_view(model=Entry)

entry_create = CreateView.as_view(model=Entry, form_class=EntryForm)

entry_update = UpdateView.as_view(model=Entry, form_class=EntryForm)


class ProposalList(ProposalMixin, ListView):
    model = Proposal
    paginate_by = 10


class ProposalDetail(ProposalDetailMixin, DetailView):
    model = Proposal


class ProposalUpdate(LoginRequiredMixin, UpdateView):
    model = Proposal
    form_class = ProposalForm
Beispiel #15
0
urlpatterns = patterns('',
    url(r'^$', RedirectView.as_view(url="main/"), name="root_url"),
    (r'^main/$', 'starter.views.main_page'),
    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:
Beispiel #16
0
            name="vendor-list",
        ),
    url(r'^(?P<slug>[-\w]+)/$',
        DetailView.as_view(
            model=Vendor, 
            queryset=Vendor.public_objects.all()),
            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/$', 
Beispiel #17
0
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic.edit import UpdateView

from demo.models import SimpleConcurrentModel

# try:
# from django.apps import AppConfig  # noqa
#     import django
#     django.setup()
# except ImportError:
#     pass

admin.autodiscover()

urlpatterns = (url('cm/(?P<pk>\d+)/',
                   UpdateView.as_view(model=SimpleConcurrentModel),
                   name='concurrent-edit'), url(r'^admin/', admin.site.urls))
Beispiel #18
0
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')))
Beispiel #19
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import Room as Table

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="room/list.html"),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create-room'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list-rooms'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^api/users/$', UserListAPIView.as_view(), name='api-list-users'),
    url(r'^add/$',
        TemplateView.as_view(template_name="room/crud_form.html"),
        name='add-room'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name="room/crud_form.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update-room'),
]
Beispiel #20
0
urlpatterns = patterns('',
    url(r'^$', login_required(ListView.as_view(
        model=Survey,
        template_name='dashboard/survey_list.html',
        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"
Beispiel #21
0
                                template_name="curriculum/list.html")),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        permission_required('curriculum.add_curriculum',
                            login_url='core:not_found')(TemplateView.as_view(
                                template_name="curriculum/form.html")),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        permission_required('curriculum.change_curriculum',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="curriculum/form.html",
                                model=Table,
                                fields=['id'])),
        name='update'),
    url(r'^view/(?P<pk>[0-9]+)/$',
        permission_required('curriculum.view_curriculum',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="curriculum/detail.html",
                                model=Table,
                                fields=['id'])),
        name='detail'),
]
Beispiel #22
0
    ),
    url(
        r'^add/$',
        CreateView.as_view(
            model=CD,
            form_class=CDForm,
            template_name='music/cd_form.html',
            success_url=reverse_lazy('cd.list')
        ),
        name='cd.add'
    ),
    url(
        r'^edit/(?P<pk>\d+)/$',
        UpdateView.as_view(
            model=CD,
            form_class=CDForm,
            template_name='music/cd_form.html',
            success_url=reverse_lazy('cd.list')
        ),
        name='cd.edit'
    ),
    url(
        r'^delete/(?P<pk>\d+)/$',
        DeleteView.as_view(
            model=CD,
            success_url=reverse_lazy('cd.list')
        ),
        name='cd.delete'
    ),
)
Beispiel #23
0
 ),
 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(
Beispiel #24
0
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'),
]

Beispiel #25
0
        permission_required('item.view_feeitem', login_url='core:not_found')(
            TemplateView.as_view(template_name=module + "/list.html")),
        name="index"),
    url(r'^api/create/$',
        permission_required('item.add_feeitem', login_url='core:not_found')(
            CreateAPIView.as_view()),
        name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        permission_required('item.delete_feeitem',
                            login_url='core:not_found')(DestroyView.as_view()),
        name='api-delete'),
    url(r'^api/list/$',
        permission_required('item.view_feeitem',
                            login_url='core:not_found')(ListAPIView.as_view()),
        name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        permission_required('item.change_feeitem', login_url='core:not_found')(
            UpdateAPIView.as_view()),
        name='api-update'),
    url(r'^add/$',
        permission_required('item.add_feeitem', login_url='core:not_found')(
            TemplateView.as_view(template_name=module + "/form.html")),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        permission_required('item.change_feeitem', login_url='core:not_found')(
            UpdateView.as_view(template_name=module + "/form.html",
                               model=Table,
                               fields=['id', 'name'])),
        name='update'),
]
Beispiel #26
0
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"),
    )
Beispiel #27
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.edit import UpdateView
from tests.models import SimpleConcurrentModel


try:
    from django.apps import AppConfig  # noqa
    import django
    django.setup()
except ImportError:
    pass

admin.autodiscover()


urlpatterns = patterns('',
                       url('cm/(?P<pk>\d+)/',
                           UpdateView.as_view(model=SimpleConcurrentModel),
                           name='concurrent-edit'),
                       (r'^admin/', include(include(admin.site.urls))),
                       (r'', include(include(admin.site.urls))))
Beispiel #28
0
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
from notes.models import Note, Topic

from notes.views import NoteList, NoteDetail

urlpatterns = patterns('',
    url(r'^$', NoteList.as_view(), name='notes-index'),
    url('^topics/$', ListView.as_view(model=Topic), name='notes-topic-list'),
    url('^topics/(?P<slug>[+\w]+)/$', DetailView.as_view(model=Topic), name='notes-topic-detail'),
    url(r'^add/$', login_required(CreateView.as_view(model=Note)), name='notes-create'),
    url('^(?P<pk>\d+)/$', NoteDetail.as_view(), name='notes-view'),
    url('^(?P<pk>\d+)/edit/$', login_required(UpdateView.as_view(model=Note)), name='notes-edit'),
)
Beispiel #29
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, ),
    ),
    ###################################
)
Beispiel #30
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()),
]
Beispiel #31
0
 url(r'^api/update/item/(?P<pk>[0-9]+)/$',
     UpdateItemAPIView.as_view(),
     name='api-update-item'),
 url(r'^api/close/item/(?P<pk>[0-9]+)/$',
     CloseItemAPIView.as_view(),
     name='api-update-item'),
 url(r'^add/$',
     TemplateView.as_view(template_name="countertransfer/form.html"),
     name='add'),
 # url(r'^report/$', TemplateView.as_view(template_name="countertransfer/list_report.html"), name='add'),
 url(r'^close/$',
     TemplateView.as_view(template_name="countertransfer/close.html"),
     name='close'),
 url(r'^update/(?P<pk>[0-9]+)/$',
     UpdateView.as_view(template_name="countertransfer/items.html",
                        model=Table,
                        fields=['id', 'name']),
     name='update'),
 url(r'^update/view/(?P<pk>[0-9]+)/$',
     UpdateView.as_view(template_name="countertransfer/item_view.html",
                        model=Table,
                        fields=['id', 'name']),
     name='update-view'),
 url(r'^close/item/(?P<pk>[0-9]+)/$',
     UpdateView.as_view(template_name="countertransfer/item_closing.html",
                        model=Table,
                        fields=['id', 'name']),
     name='close-item'),
 url(r'^close/item/view/(?P<pk>[0-9]+)/$',
     UpdateView.as_view(
         template_name="countertransfer/item_closing_view.html",
Beispiel #32
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import VisaTransactions as Table

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="visa_transactions/list.html"),
        name="index"),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/list/detail/$',
        ListSingleAPIView.as_view(),
        name='api-list-detail'),
    url(r'^api/create/$',
        CreateAPIView.as_view(),
        name='api-create-mpesa-payment'),
    url(r'^add/$',
        TemplateView.as_view(template_name="visa_transactions/form.html"),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name="visa_transactions/form.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update'),
    url(r'^api/detail/(?P<pk>[0-9]+)/$',
        DetailAPIView.as_view(),
        name='api-mpesa-detail'),
]
Beispiel #33
0
# class EntryActionMixin(object):

#     @property
#     def action(self):
#         msg = "{0} is missing action.".format(self.__class__)
#         raise NotImplementedError(msg)

#     def form_valid(self, form):
#         msg = "Entrada {0}!".format(self.action)
#         messages.info(self.request, msg)
#         return super(EntryActionMixin, self).form_valid(form)

entry_create = CreateView.as_view(model=Entry, form_class=EntryForm)

entry_update = UpdateView.as_view(model=Entry, form_class=EntryForm)


class ProposalList(ProposalMixin, ListView):
    model = Proposal
    paginate_by = 10


proposal_detail = DetailView.as_view(model=Proposal)

# class ProposalDetail(DetailView):
#     template_name = 'core/proposal/proposal_detail.html'
#     model = Proposal

#     def get_context_data(self, **kwargs):
#         try:
Beispiel #34
0
from django.shortcuts import render
from django.views.generic import CreateView, ListView, DetailView
from django.views.generic.edit import UpdateView
from orcamentos.crm.models import Person
from orcamentos.crm.forms import PersonForm, EmployeeForm

# FirstnameSearchMixin
person_list = ListView.as_view(model=Person, paginate_by=10)

person_detail = DetailView.as_view(model=Person)

# LoginRequiredMixin
person_create = CreateView.as_view(model=Person, form_class=PersonForm)

# LoginRequiredMixin
person_update = UpdateView.as_view(model=Person, form_class=PersonForm)

# customer_list = ListView.as_view(model=Customer, paginate_by=10)

# customer_detail = DetailView.as_view(model=Customer)

# # LoginRequiredMixin
# customer_create = CreateView.as_view(model=Customer, form_class=CustomerForm)

# # LoginRequiredMixin
# customer_update = UpdateView.as_view(model=Customer, form_class=CustomerForm)


def employee_create(request):
    if request.method == 'POST':
        form = EmployeeForm(request.POST)
Beispiel #35
0
from .views import PHOTO_FORM_FIELDS, ALBUM_FORM_FIELDS
from .views import PhotoCreate, AlbumCreate, LibraryView, AlbumView, TagView
from django.urls import reverse_lazy

urlpatterns = [
    url(r'^$',
        login_required(
            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,
Beispiel #36
0
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"),
)
Beispiel #37
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'),
Beispiel #38
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import PropertyType as Table


urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="propertytype/list.html"), name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$', DestroyView.as_view(), name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),

    url(r'^api/update/(?P<pk>[0-9]+)/$', UpdateAPIView.as_view(), name='api-update'),
    url(r'^add/$', TemplateView.as_view(template_name="propertytype/form.html"), name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$', UpdateView.as_view(template_name="propertytype/form.html", model=Table, fields=['id', 'name']),
        name='update'),
]

Beispiel #39
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import Parent as Table

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="parent/list.html"),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        TemplateView.as_view(template_name="parent/form.html"),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name="parent/form.html",
                           model=Table,
                           fields=['id', 'first_name']),
        name='update'),
]
Beispiel #40
0
    url(
        r'^(?P<slug>[-\w]+)/$',
        DetailView.as_view(model=Vendor, queryset=Vendor.public_objects.all()),
        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",
    #    ))),
Beispiel #41
0
      LogoutView.as_view(template_name='accounts/logout.html'),
      name='logout'),
 path('change-password/',
      PasswordChangeView.as_view(
          success_url=reverse_lazy('accounts:change-password-done')),
      name='change-password'),
 path('change-password-done/',
      PasswordChangeDoneView.as_view(
          template_name='accounts/change-password-done.html'),
      name='change-password-done'),
 path('update/<int:pk>',
      UpdateView.as_view(template_name='accounts/update.html',
                         success_url=reverse_lazy('accounts:profile'),
                         model=User,
                         fields=[
                             'username',
                             'first_name',
                             'last_name',
                             'email',
                         ]),
      name='update'),
 path(
     'reset/',
     PasswordResetView.as_view(
         success_url=reverse_lazy('accounts:reset-done'),
         from_email='*****@*****.**',  #???
         subject_template_name='accounts/password_reset_subject.txt',
         email_template_name='accounts/password_reset_email.html',
     ),
     name='reset'),
 path('reset-confirm/<uidb64>/<token>/',
Beispiel #42
0
    url(r'^$', views.home, name="home"),
    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"),

)

Beispiel #43
0
    url(r'^$',
        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'),
]
Beispiel #44
0
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import Menu as Table

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="menu/list.html"),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/list/(?P<pk>[0-9]+)/$',
        ListAPIView.as_view(),
        name='api-list-category'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        TemplateView.as_view(template_name="menu/form.html"),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name="menu/form.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update'),
]
Beispiel #45
0
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
from notes.models import Note, Topic

from notes.views import NoteList, NoteDetail

urlpatterns = patterns(
    '',
    url(r'^$', NoteList.as_view(), name='notes-index'),
    url('^topics/$', ListView.as_view(model=Topic), name='notes-topic-list'),
    url('^topics/(?P<slug>[+\w]+)/$',
        DetailView.as_view(model=Topic),
        name='notes-topic-detail'),
    url(r'^add/$',
        login_required(CreateView.as_view(model=Note)),
        name='notes-create'),
    url('^(?P<pk>\d+)/$', NoteDetail.as_view(), name='notes-view'),
    url('^(?P<pk>\d+)/edit/$',
        login_required(UpdateView.as_view(model=Note)),
        name='notes-edit'),
)
Beispiel #46
0
 ),
 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(
Beispiel #47
0
 path('accounts/password_change/',
      PasswordChangeView.as_view(
          template_name='mainapp/registro/trocaSenha.html',
          success_url=reverse_lazy('sec-password_change_done'),
      ),
      name='sec-password_change'),
 path('accounts/password_change_done/',
      PasswordChangeDoneView.as_view(
          template_name='mainapp/registro/trocaFeita.html', ),
      name='sec-password_change_done'),
 path('accounts/terminaRegistro/<int:pk>/',
      UpdateView.as_view(
          template_name='mainapp/registro/paginaUsuario.html',
          success_url=reverse_lazy('sec-home'),
          model=User,
          fields=[
              'first_name',
              'last_name',
              'email',
          ],
      ),
      name='sec-completaDadosUsuario'),
 path('accounts/password_reset/',
      PasswordResetView.as_view(
          template_name='mainapp/registro/formRecuperacao.html',
          success_url=reverse_lazy('sec-password_reset_done'),
          email_template_name='mainapp/registro/paginaRecuperacao.html',
          subject_template_name='mainapp/registro/password_change_text.txt',
          from_email='*****@*****.**',
      ),
      name='password_reset'),
 path('accounts/password_reset_done/',
Beispiel #48
0
class EntryList(EntryMixin, ListView):
    model = Entry
    paginate_by = 10


def entry_detail_json(request, pk):
    data = Entry.objects.filter(pk=pk)
    s = serializers.serialize("json", data)
    return HttpResponse(s)

entry_detail = DetailView.as_view(model=Entry)

entry_create = CreateView.as_view(model=Entry, form_class=EntryForm)

entry_update = UpdateView.as_view(model=Entry, form_class=EntryForm)


class ProposalList(ProposalMixin, ListView):
    model = Proposal
    paginate_by = 10


class ProposalDetail(ProposalDetailMixin, DetailView):
    model = Proposal


class ProposalUpdate(LoginRequiredMixin, UpdateView):
    model = Proposal
    form_class = ProposalForm
Beispiel #49
0
                for products, solution_vars, A_p, solution_vars_ints, solution_vars_percent in context["solution"]:
                    mealplan_product_cache = MealPlanProduct(meal_plan=self.object, product=products, quantity=solution_vars.varValue, servings_to_use=solution_vars_ints.varValue)
                    mealplan_product_cache.save()
                self.object.save()
        return context

staff_required = user_passes_test(lambda u: u.is_staff)

urlpatterns = patterns('',
                       #mealplans
                       url(r'^mealplan/$', ListView.as_view(queryset=MealPlan.objects.all().order_by("-votes"), template_name="mealplan_list.html"), name="read_mealplans"),
                       url(r'^mealplan/create/$', login_required(MealPlanCreateView.as_view(form_class=MealPlanForm, template_name="mealplan_form.html")), name="create_mealplan"),
                       url(r'^mealplan/(?P<pk>\d+)/details/$',  MealPlanDetailView.as_view(model=MealPlan, template_name="mealplan_detail.html"), name="read_mealplan"),
                       url(r'^mealplan/(?P<pk>\d+)/edit/$', login_required(MealPlanUpdateView.as_view(model=MealPlan,form_class=MealPlanForm, template_name="mealplan_form.html")), name="update_mealplan"),
                       url(r'^(?P<model>mealplan|product)/(?P<pk>\d+)/(?P<direction>up|down)/$', vote_for, name="vote"),
                       url(r'^count/$', product_count, name="product_count"),
                       #products
                       url(r'^product/getinfo/', getinfo, name="getinfo"),
                       url(r'^product/$', ListView.as_view(queryset=Product.objects.all().order_by("-votes"), template_name="product_list.html"), name="read_products"),
                       url(r'^product/create/$', login_required(ProductCreateView.as_view(form_class=ProductForm, template_name="product_form.html")), name="create_product"),
                       url(r'^product/(?P<pk>\d+)/details/$',  DetailView.as_view(model=Product, template_name="product_detail.html"), name="read_product"),
                       url(r'^product/(?P<pk>\d+)/edit/$', staff_required(ProductUpdateView.as_view(model=Product, form_class=ProductForm, template_name="product_form.html")), name="update_product"),
                      #nutrients
                       url(r'^nutrient/$', ListView.as_view(model=Nutrient, template_name="nutrient_list.html"), name="read_nutrients"),
                       url(r'^nutrient/create/$', staff_required(CreateView.as_view(form_class=NutrientForm, template_name="nutrient_form.html")), name="create_nutrient"),
                       url(r'^nutrient/(?P<pk>\d+)/details/$',  DetailView.as_view(model=Nutrient, template_name="nutrient_detail.html"), name="read_nutrient"),
                       url(r'^nutrient/(?P<pk>\d+)/edit/$', staff_required(UpdateView.as_view(model=Nutrient,form_class=NutrientForm, template_name="nutrient_form.html")), name="update_nutrient"),
                       #feedback
                       url(r'^feedback/create/$', CreateView.as_view(form_class=FeedbackForm, template_name="form.html"), name="create_feedback"),
                       
)
Beispiel #50
0
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')

]
Beispiel #51
0
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.base import TemplateView
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import UpdateView, CreateView

from web.barns.models import Barn

urlpatterns = patterns('',
    url(r'^$', ListView.as_view(model=Barn, template_name='generic/list.html'), name='list'),
    url(r'^/(?P<pk>\d+)$', DetailView.as_view(model=Barn, template_name='generic/detail.html'), name='detail'),
    
    url(r'^/new$', CreateView.as_view(model=Barn, template_name='generic/form.html', success_url='/barns/%(id)s'), name='create'),
    url(r'^/(?P<pk>\d+)/edit$', UpdateView.as_view(model=Barn, template_name='generic/form.html', success_url='/barns/%(id)s'), name='edit'),
)
Beispiel #52
0
from django.conf.urls import url
from django.views.generic import TemplateView
from django.views.generic.edit import UpdateView

from .api.views import *
from .models import AcademicYear as Table

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="academic_year/list.html"),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        TemplateView.as_view(template_name="academic_year/form.html"),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        UpdateView.as_view(template_name="academic_year/form.html",
                           model=Table,
                           fields=['id', 'name']),
        name='update'),
]
Beispiel #53
0
     name='wbinventory_item_create',
 ),
 url(
     r'^items/(?P<pk>\d+)/$',
     ItemDetailView.as_view(
         context_object_name='item',
         template_name='wbinventory/item/detail.html',
         model=Item,
     ),
     name='wbinventory_item_detail',
 ),
 url(
     r'^items/(?P<pk>\d+)/edit/$',
     UpdateView.as_view(
         context_object_name='item',
         template_name='wbinventory/item/update.html',
         model=Item,
         form_class=ItemForm,
     ),
     name='wbinventory_item_update',
 ),
 url(
     r'^itemtransactions/create/$',
     ItemTransactionCreateView.as_view(
         context_object_name='itemtransaction',
         model=ItemTransaction,
     ),
     name='wbinventory_itemtransaction_create',
 ),
 url(
     r'^search/$',
     SiteSearchListView.as_view(),
Beispiel #54
0
                                template_name="exam_configuration/list.html")),
        name="index"),
    url(r'^api/create/$', CreateAPIView.as_view(), name='api-create'),
    url(r'^api/delete/(?P<pk>[0-9]+)/$',
        DestroyView.as_view(),
        name='api-delete'),
    url(r'^api/list/$', ListAPIView.as_view(), name='api-list'),
    url(r'^api/update/(?P<pk>[0-9]+)/$',
        UpdateAPIView.as_view(),
        name='api-update'),
    url(r'^add/$',
        permission_required('configuration.add_examconfiguration',
                            login_url='core:not_found')(TemplateView.as_view(
                                template_name="exam_configuration/form.html")),
        name='add'),
    url(r'^update/(?P<pk>[0-9]+)/$',
        permission_required('configuration.change_examconfiguration',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="exam_configuration/form.html",
                                model=Table,
                                fields=['id'])),
        name='update'),
    url(r'^view/(?P<pk>[0-9]+)/$',
        permission_required('configuration.view_examconfiguration',
                            login_url='core:not_found')(UpdateView.as_view(
                                template_name="exam_configuration/detail.html",
                                model=Table,
                                fields=['id'])),
        name='detail'),
]
Beispiel #55
0
     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,
     template_name="confirm_bill.html",
     success_url="/",
 )), name="bill_remove"),
 url(r"^bill/update/(?P<pk>\d+)/$", login_required(UpdateView.as_view(
     model=Bill,
     template_name="form_bill.html",
Beispiel #56
0
    (r'^(favicon\.ico|robots\.txt|apple-touch-icon\.png)\/?$', 
        'django.views.static.serve', {
            'document_root': settings.STATICFILES_DIRS[0],
    }),
    
    (r"^mailsender/$", mailinglists.mailsender),
                       
    (r"^ical(.php|.ics)?/$", ical.cal_events),
    
    (r'^users/login/$', 'django.contrib.auth.views.login', 
        dict(authentication_form=forms.LoginForm)),
    (r'^users/logout/$', login_required(auth.views.logout)),
    (r'^users/profile/$', views.is_active_required(
        lambda request: UpdateView.as_view(
            model=auth.models.User, form_class=forms.UserForm,
            success_url="/users/profile/")
        (request, pk=request.user.pk))),
                       
    (r'^event/signup/(?P<event_pk>\d+)$', views.is_active_required(
        views.EventSignup.as_view(success_url="/upcoming/"))),

    #(r'^sentry/', include('sentry.web.urls')),
    (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', 
        {'sitemaps': {'pages': PageSitemap(
            queryset=Page.objects.filter(require_login=False,
                                         require_permission=False))}}),
    
    (r'', include('feincms.urls')),
)

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)