mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +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:
parent
e55924b833
commit
5a2b52c9e8
@ -101,7 +101,7 @@ def update_object(request, model, object_id=None, slug=None,
|
||||
except ObjectDoesNotExist:
|
||||
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:
|
||||
new_data = request.POST.copy()
|
||||
|
Loading…
x
Reference in New Issue
Block a user