Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

magic-removal: Fixed #1674 -- Generic update_object() view now handle…

…s PKs named something other than 'id'

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5a2b52c9e8007edc483a4e94988c58106a6d2b4b 1 parent e55924b
Adrian Holovaty authored April 23, 2006

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/views/generic/create_update.py
2  django/views/generic/create_update.py
@@ -101,7 +101,7 @@ def update_object(request, model, object_id=None, slug=None,
101 101
     except ObjectDoesNotExist:
102 102
         raise Http404, "No %s found for %s" % (model._meta.verbose_name, lookup_kwargs)
103 103
 
104  
-    manipulator = model.ChangeManipulator(object.id, follow=follow)
  104
+    manipulator = model.ChangeManipulator(getattr(object, object._meta.pk.name), follow=follow)
105 105
 
106 106
     if request.POST:
107 107
         new_data = request.POST.copy()

0 notes on commit 5a2b52c

Please sign in to comment.
Something went wrong with that request. Please try again.