#11992: modelformset_factory
-------------------------------------------------+--------------------------
Reporter: unk2k <[email protected]> | Owner: nobody
Status: closed | Milestone: 1.2
Component: Forms | Version: 1.1
Resolution: invalid | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------------+--------------------------
Old description:
> Environment:
>
> Request Method: POST
> Request URL: http://panel.raf-leasing.ru:8000/company/finance/2544400/
> Django Version: 1.2 pre-alpha
> Python Version: 2.6.2
> Installed Applications:
> ['sessions', 'company', 'auth', 'lib']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
> 'sessions.middleware.SessionMiddleware',
> 'auth.middleware.AuthMiddleware',
> 'django.middleware.transaction.TransactionMiddleware')
>
> Traceback:
> File "/usr/local/lib/python2.6/dist-
> packages/django/core/handlers/base.py" in get_response
> 92. response = callback(request, *callback_args,
> **callback_kwargs)
> File "/home/r00t/django/rafpaneloracle2/lib/isauth.py" in wrap
> 8. return f(request, *args, **kwargs)
> File "/home/r00t/django/rafpaneloracle2/lib/render.py" in wrapper
> 20. output = func(request, *args, **kw)
> File "/home/r00t/django/rafpaneloracle2/company/views.py" in finance
> 140. formset = FinanceSet(request.POST,
> queryset=Finance.objects.filter(company_id=company.id,
> quarter__in=quarter, year__in=year))
> File "/home/r00t/django/rafpaneloracle2/company/forms.py" in __init__
> 209. super (FinanceForm,self ).__init__(*args,**kwargs) #
> populates the post
> File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
> __init__
> 459. super(BaseModelFormSet, self).__init__(**defaults)
> File "/usr/local/lib/python2.6/dist-packages/django/forms/formsets.py" in
> __init__
> 44. self._construct_forms()
> File "/usr/local/lib/python2.6/dist-packages/django/forms/formsets.py" in
> _construct_forms
> 88. self.forms.append(self._construct_form(i))
> File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
> _construct_form
> 475. pk = self.data[pk_key]
> File "/usr/local/lib/python2.6/dist-
> packages/django/utils/datastructures.py" in __getitem__
> 203. raise MultiValueDictKeyError, "Key %r not found in %r"
> % (key, self)
>
> Exception Type: MultiValueDictKeyError at /company/finance/2544400/
> Exception Value: Key 'form-0-id' not found in <QueryDict:
> {u'form-0-capital': [u'0,00'], u'form-0-actives': [u'0,00'],
> u'form-2-charity': [u'0,00'], u'form-3-income': [u'0,00'],
> u'form-1-actives': [u'0,00'], u'form-1-charity': [u'0,00'],
> u'form-0-income': [u'0,00'], u'form-1-capital': [u'0,00'],
> u'form-3-capital': [u'0,00'], u'form-3-actives': [u'0,00'], u'form-
> TOTAL_FORMS': [u'4'], u'form-3-charity': [u'0,00'], u'form-2-capital':
> [u'0,00'], u'form-2-actives': [u'0,00'], u'form-0-charity': [u'0,00'], u
> 'form-INITIAL_FORMS': [u'4'], u'form-2-income': [u'0,00'],
> u'form-1-income': [u'0,00']}>
New description:
{{{
Environment:
Request Method: POST
Request URL: http://panel.raf-leasing.ru:8000/company/finance/2544400/
Django Version: 1.2 pre-alpha
Python Version: 2.6.2
Installed Applications:
['sessions', 'company', 'auth', 'lib']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'sessions.middleware.SessionMiddleware',
'auth.middleware.AuthMiddleware',
'django.middleware.transaction.TransactionMiddleware')
Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/r00t/django/rafpaneloracle2/lib/isauth.py" in wrap
8. return f(request, *args, **kwargs)
File "/home/r00t/django/rafpaneloracle2/lib/render.py" in wrapper
20. output = func(request, *args, **kw)
File "/home/r00t/django/rafpaneloracle2/company/views.py" in finance
140. formset = FinanceSet(request.POST,
queryset=Finance.objects.filter(company_id=company.id,
quarter__in=quarter, year__in=year))
File "/home/r00t/django/rafpaneloracle2/company/forms.py" in __init__
209. super (FinanceForm,self ).__init__(*args,**kwargs) #
populates the post
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
__init__
459. super(BaseModelFormSet, self).__init__(**defaults)
File "/usr/local/lib/python2.6/dist-packages/django/forms/formsets.py" in
__init__
44. self._construct_forms()
File "/usr/local/lib/python2.6/dist-packages/django/forms/formsets.py" in
_construct_forms
88. self.forms.append(self._construct_form(i))
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
_construct_form
475. pk = self.data[pk_key]
File "/usr/local/lib/python2.6/dist-
packages/django/utils/datastructures.py" in __getitem__
203. raise MultiValueDictKeyError, "Key %r not found in %r"
% (key, self)
Exception Type: MultiValueDictKeyError at /company/finance/2544400/
Exception Value: Key 'form-0-id' not found in <QueryDict:
{u'form-0-capital': [u'0,00'], u'form-0-actives': [u'0,00'],
u'form-2-charity': [u'0,00'], u'form-3-income': [u'0,00'],
u'form-1-actives': [u'0,00'], u'form-1-charity': [u'0,00'],
u'form-0-income': [u'0,00'], u'form-1-capital': [u'0,00'],
u'form-3-capital': [u'0,00'], u'form-3-actives': [u'0,00'], u'form-
TOTAL_FORMS': [u'4'], u'form-3-charity': [u'0,00'], u'form-2-capital':
[u'0,00'], u'form-2-actives': [u'0,00'], u'form-0-charity': [u'0,00'], u
'form-INITIAL_FORMS': [u'4'], u'form-2-income': [u'0,00'],
u'form-1-income': [u'0,00']}>
}}}
Comment (by Alex):
Please use the preview button.
--
Ticket URL: <http://code.djangoproject.com/ticket/11992#comment:2>
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---