On updating from Django 1.5 to 1.6 I'm seeing MultiValueDictKeyError
(see below) on saving a fairly complex set of linked models in the Admin
whether anything actually changed or not.
Postgres 9.1
Python 2.7 and 3.4
Apache on Ubuntu 12.04 and manage.py runserver on Windows 8.1
Downgrading to 1.5 again makes the problem go away on all the above. So
that's what I've done.
I'll dig a bit deeper via Google shortly but it might save me a heap of
time if anyone else seen this and found a nice simple fix?
Thanks
Mike
<below>
Environment:
Request Method: POST
Request URL: http://localhost:8000/admin/substance/substance/1/
Django Version: 1.6.5
Python Version: 3.4.0
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.staticfiles',
'common',
'company',
'workplace',
'substance',
'refer')
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware')
Traceback:
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\core\handlers\base.py"
in get_response
112. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\options.py"
in wrapper
432. return self.admin_site.admin_view(view)(*args,
**kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py"
in _wrapped_view
99. response = view_func(request, *args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\views\decorators\cache.py"
in _wrapped_view_func
52. response = view_func(request, *args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\sites.py" in
inner
198. return view(request, *args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py"
in _wrapper
29. return bound_func(*args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py"
in _wrapped_view
99. response = view_func(request, *args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\decorators.py"
in bound_func
25. return func(self, *args2, **kwargs2)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\db\transaction.py" in
inner
371. return func(*args, **kwargs)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\contrib\admin\options.py"
in change_view
1229. if all_valid(formsets) and form_validated:
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
all_valid
415. if not formset.is_valid():
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
is_valid
292. err = self.errors
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
errors
267. self.full_clean()
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
full_clean
314. form = self.forms[i]
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\functional.py"
in __get__
49. res = instance.__dict__[self.func.__name__] =
self.func(instance)
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
forms
133. forms = [self._construct_form(i) for i in
xrange(self.total_form_count())]
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\formsets.py" in
<listcomp>
133. forms = [self._construct_form(i) for i in
xrange(self.total_form_count())]
File "C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\models.py"
in _construct_form
848. form = super(BaseInlineFormSet, self)._construct_form(i,
**kwargs)
File "C:\Users\mike\env\xxdx3\lib\site-packages\django\forms\models.py"
in _construct_form
564. pk = self.data[pk_key]
File
"C:\Users\mike\env\xxdx3\lib\site-packages\django\utils\datastructures.py"
in __getitem__
301. raise MultiValueDictKeyError(repr(key))
Exception Type: MultiValueDictKeyError at /admin/substance/substance/1/
Exception Value: "'uses-0-id'"
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/53FE6E43.2040006%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment