#5919: 6655 formset update makes adding imposible (when model have inlines)
-------------------------------------------+--------------------------------
Reporter: LongMan <[EMAIL PROTECTED]> | Owner: nobody
Status: reopened | Component: Admin
interface
Version: newforms-admin | Resolution:
Keywords: inline add | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------------------------+--------------------------------
Changes (by Petr Marhoun <[EMAIL PROTECTED]>):
* status: closed => reopened
* has_patch: 0 => 1
* resolution: worksforme =>
Comment:
I think this ticket should not be closed - it is not fixed in django.
This code from django.contrib.admin.!ModelAdmin.add_view is problematic:
{{{
#!python
if request.method == 'POST':
form = ModelForm(request.POST, request.FILES)
for FormSet in self.formsets_add(request):
inline_formset = FormSet(data=request.POST,
files=request.FILES)
inline_formsets.append(inline_formset)
# ...
else:
form = ModelForm(initial=request.GET)
for FormSet in self.formsets_add(request):
inline_formset = FormSet()
inline_formsets.append(inline_formset)
}}}
It is not compatible with django.newforms.models.!InlineFormset:
{{{
#!python
class InlineFormset(BaseModelFormSet):
"""A formset for child objects related to a parent."""
def __init__(self, instance, data=None, files=None):
# ...
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5919#comment:2>
Django Code <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
-~----------~----~----~----~------~----~------~--~---