diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-04-23 21:21:51 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-04-23 21:21:51 +0000 |
| commit | 5a2b52c9e8007edc483a4e94988c58106a6d2b4b (patch) | |
| tree | 80dd79ff17abfdb36c185ba3c83ce1a7e2ead8fe /django | |
| parent | e55924b833b77e98d24768749409cf2705f61180 (diff) | |
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
Diffstat (limited to 'django')
| -rw-r--r-- | django/views/generic/create_update.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/views/generic/create_update.py b/django/views/generic/create_update.py index 9f0f7a416d..b95eb5a7e8 100644 --- a/django/views/generic/create_update.py +++ b/django/views/generic/create_update.py @@ -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() |
