当前位置: 首页>>代码示例>>Python>>正文


Python edit.UpdateView类代码示例

本文整理汇总了Python中django.views.generic.edit.UpdateView的典型用法代码示例。如果您正苦于以下问题:Python UpdateView类的具体用法?Python UpdateView怎么用?Python UpdateView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UpdateView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: item_metadata

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}))
开发者ID:Krazylee,项目名称:spindle-code,代码行数:7,代码来源:views.py

示例2: get_context_data

    def get_context_data(self, **kwargs):

        context = UpdateView.get_context_data(self, **kwargs)
        context['title'] = '%s <small>(%s)</small>' % (
            self.object.get_full_name(),
            self.object.email)
        return context
开发者ID:cmjatai,项目名称:cmj,代码行数:7,代码来源:views_auth.py

示例3: get_context_data

 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context['pk'] = self.kwargs['pk']
     context['action'] = reverse('item_editar', kwargs={'pk':self.kwargs['pk']})
     if self.ocurrio_error :
         context['nodefault'] = '__panel.html'
     return context
开发者ID:nelsondspy,项目名称:projectmn,代码行数:7,代码来源:view_item.py

示例4: get_context_data

    def get_context_data(self, **kwargs):

        context = UpdateView.get_context_data(self, **kwargs)
        enroll = Enroll.objects.filter(student=self.object).order_by('enroll_date')
        context['enroll'] = enroll.filter(enroll_activate=True, enroll_finished=True)
        context['pre_enroll'] = enroll.filter(enroll_activate=True, enroll_finished=False)
        return context
开发者ID:ChicoMTZ,项目名称:academica,代码行数:7,代码来源:Auth.py

示例5: render_to_response

    def render_to_response(self, context):

        if self.request.is_ajax():
            return JSONHybridProcessFormViewMixin.render_to_response(self,
                                                                     context)

        return UpdateView.render_to_response(self, context)
开发者ID:snowman-st,项目名称:edu-back,代码行数:7,代码来源:response.py

示例6: get

 def get(self, request, *args, **kwargs):
     """
     Save the initial referer
     """
     self.referer = request.META.get('HTTP_REFERER', '')
     request.session['login_referer'] = self.referer
     return UpdateView.get(self, request, *args, **kwargs)
开发者ID:Arken94,项目名称:django-wiki,代码行数:7,代码来源:accounts.py

示例7: patterns

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))))
开发者ID:MikeAmy,项目名称:django-concurrency,代码行数:22,代码来源:urls.py

示例8: get_context_data

 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context['action'] = reverse('rol_permisos_edita',kwargs={'pk':self.kwargs['pk']})
     if self.templ_base_error:
         context['nodefault'] = self.templ_base_error
     return context
开发者ID:nelsondspy,项目名称:projectmn,代码行数:6,代码来源:views.py

示例9: patterns

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'),
)
开发者ID:rfadams,项目名称:python-django-heroku,代码行数:15,代码来源:urls.py

示例10: form_valid

 def form_valid(self, form):
     form.save()
     return UpdateView.form_valid(self, form)
开发者ID:kripaelizabethtom,项目名称:workshop,代码行数:3,代码来源:views.py

示例11: url

 ),
 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(
开发者ID:wooyek,项目名称:db_file_storage,代码行数:32,代码来源:urls.py

示例12: url

 ),
 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(
开发者ID:victor-o-silva,项目名称:db_file_storage,代码行数:32,代码来源:urls.py

示例13: patterns

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"),
)
开发者ID:bilougit,项目名称:english_level,代码行数:26,代码来源:urls.py

示例14: get_context_data

 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context['action'] = reverse('solicitud_edita', \
                                 kwargs={'pk':self.kwargs['pk']})
     return context
开发者ID:nelsondspy,项目名称:projectmn,代码行数:5,代码来源:view_solicitud.py

示例15: url

                           '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', ),
开发者ID:JohnWilson12345,项目名称:geoevents,代码行数:32,代码来源:urls.py


注:本文中的django.views.generic.edit.UpdateView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。