#16869: BaseGenericInlineFormSet does not use form's save() method
------------------------+--------------------------------------
 Reporter:  mattaustin  |          Owner:  nobody
     Type:  Bug         |         Status:  new
Milestone:              |      Component:  contrib.contenttypes
  Version:  1.3         |       Severity:  Normal
 Keywords:              |   Triage Stage:  Unreviewed
Has patch:  0           |  Easy pickings:  1
    UI/UX:  0           |
------------------------+--------------------------------------
 Changeset [12268] introduced the save_new() method on
 BaseGenericInlineFormSet - however this uses creates a new object based on
 self.model and thehn uses save_instance(), bypassing any custom code on
 the form's save() method.

 Would the following not provide the same functionality and honor the
 form's save() method?

 {{{#!python
     def save_new(self, form, commit=True):
         setattr(form.instance, self.ct_field.get_attname(),
             ContentType.objects.get_for_model(self.instance).pk)
         setattr(form.instance, self.ct_fk_field.get_attname(),
             self.instance.pk)
         return form.save(commit=commit)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16869>
Django <https://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.

Reply via email to