1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

magic-removal: Fixed #1674 -- Generic update_object() view now handles PKs named something other than 'id'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-04-23 21:21:51 +00:00
parent e55924b833
commit 5a2b52c9e8

View File

@ -101,7 +101,7 @@ def update_object(request, model, object_id=None, slug=None,
except ObjectDoesNotExist: except ObjectDoesNotExist:
raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs) raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs)
manipulator = model.ChangeManipulator(object.id, follow=follow) manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.name), follow=follow)
if request.POST: if request.POST:
new_data = request.POST.copy() new_data = request.POST.copy()