Ticket #2859: create_update.diff
File create_update.diff, 1.1 KB (added by , 18 years ago) |
---|
-
django/views/generic/create_update.py
70 70 c[key] = value 71 71 return HttpResponse(t.render(c)) 72 72 73 def update_object(request, model, object_id=None, slug=None,73 def update_object(request, model, queryset=None, object_id=None, slug=None, 74 74 slug_field=None, template_name=None, template_loader=loader, 75 75 extra_context=None, post_save_redirect=None, 76 76 login_required=False, follow=None, context_processors=None, … … 98 98 else: 99 99 raise AttributeError("Generic edit view must be called with either an object_id or a slug/slug_field") 100 100 try: 101 object = model.objects.get(**lookup_kwargs) 101 if queryset: 102 object = queryset.get(**lookup_kwargs) 103 else: 104 object = model.objects.get(**lookup_kwargs) 102 105 except ObjectDoesNotExist: 103 106 raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs) 104 107