#12235: MultiValueDictKeyError when editing Inline objects
---------------------------------+------------------------------------------
 Reporter:  br...@playfirst.com  |       Owner:  nobody    
   Status:  new                  |   Milestone:            
Component:  Uncategorized        |     Version:  1.1       
 Keywords:                       |       Stage:  Unreviewed
Has_patch:  0                    |  
---------------------------------+------------------------------------------
 the attached simple model (Book and Author), using a custom UUID type as
 described here: http://www.gordontillman.info/computers/41-django/94
 -django-uuidfield-problem

 If you add a book with an author, and then try to edit the authors (add a
 second one, edit the name, etc), you will generate this error:

 MultiValueDictKeyError at /admin/gamedata/book/7432e312-d39b-11de-913b-
 00188b8e3ea8/

 Key 'author_set-0-id' not found in <QueryDict: {u'_save': [u'Save'], u
 'author_set-TOTAL_FORMS': [u'5'], u'author_set-0-book': [u'7432e312-d39b-
 11de-913b-00188b8e3ea8'], u'title': [u'book1'], u'author_set-0-name':
 [u'author1'], u'author_set-3-name': [u''], u'author_set-2-book':
 [u'7432e312-d39b-11de-913b-00188b8e3ea8'], u'author_set-INITIAL_FORMS':
 [u'2'], u'author_set-4-name': [u''], u'author_set-2-name': [u'asdasdasd'],
 u'author_set-3-book': [u'7432e312-d39b-11de-913b-00188b8e3ea8'],
 u'author_set-1-book': [u'7432e312-d39b-11de-913b-00188b8e3ea8'],
 u'author_set-4-book': [u'7432e312-d39b-11de-913b-00188b8e3ea8'],
 u'author_set-1-name': [u'authro2']}>

 Traceback:
 File "/usr/lib64/python2.6/site-packages/django/core/handlers/base.py" in
 get_response
   92.                 response = callback(request, *callback_args,
 **callback_kwargs)
 File "/usr/lib64/python2.6/site-packages/django/contrib/admin/options.py"
 in wrapper
   226.                 return self.admin_site.admin_view(view)(*args,
 **kwargs)
 File "/usr/lib64/python2.6/site-packages/django/utils/decorators.py" in
 __call__
   23.         return self.decorator(self.func)(*args, **kwargs)
 File "/usr/lib64/python2.6/site-packages/django/views/decorators/cache.py"
 in _wrapped_view_func
   70.         response = view_func(request, *args, **kwargs)
 File "/usr/lib64/python2.6/site-packages/django/contrib/admin/sites.py" in
 inner
   186.             return view(request, *args, **kwargs)
 File "/usr/lib64/python2.6/site-packages/django/db/transaction.py" in
 _commit_on_success
   240.                 res = func(*args, **kw)
 File "/usr/lib64/python2.6/site-packages/django/contrib/admin/options.py"
 in change_view
   826.                                   instance=new_object,
 prefix=prefix)
 File "/usr/lib64/python2.6/site-packages/django/forms/models.py" in
 __init__
   724.                                                 queryset=qs)
 File "/usr/lib64/python2.6/site-packages/django/forms/models.py" in
 __init__
   459.         super(BaseModelFormSet, self).__init__(**defaults)
 File "/usr/lib64/python2.6/site-packages/django/forms/formsets.py" in
 __init__
   44.         self._construct_forms()
 File "/usr/lib64/python2.6/site-packages/django/forms/formsets.py" in
 _construct_forms
   88.             self.forms.append(self._construct_form(i))
 File "/usr/lib64/python2.6/site-packages/django/forms/models.py" in
 _construct_form
   737.         form = super(BaseInlineFormSet, self)._construct_form(i,
 **kwargs)
 File "/usr/lib64/python2.6/site-packages/django/forms/models.py" in
 _construct_form
   475.             pk = self.data[pk_key]
 File "/usr/lib64/python2.6/site-packages/django/utils/datastructures.py"
 in __getitem__
   203.             raise MultiValueDictKeyError, "Key %r not found in %r"
 % (key, self)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12235>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=.


Reply via email to