#21428: Django 1.6 GenericRelation editable regression -------------------------------------+------------------------------------- Reporter: joshcartme | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.6 (models, ORM) | Resolution: Severity: Release blocker | Triage Stage: Accepted Keywords: GenericRelation, | Needs documentation: 0 ModelForm, Admin, editable | Patch needs improvement: 0 Has patch: 0 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by stephenmcd): The made this addition to akaari's patch using the same logic as elsewhere in the patch, which allows save_form_data to be called on the GenericRelation's form field: --- a/django/forms/models.py +++ b/django/forms/models.py @@ -82,7 +82,9 @@ def save_instance(form, instance, fields=None, fail_message='saved', # Wrap up the saving of m2m data as a function. def save_m2m(): cleaned_data = form.cleaned_data - for f in opts.many_to_many: + for f in (opts.virtual_fields + opts.many_to_many): + if not getattr(f, 'editable', False): + continue if fields and f.name not in fields: continue if exclude and f.name in exclude: -- Ticket URL: <https://code.djangoproject.com/ticket/21428#comment:7> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.8cd54a9004a2bf791748b11e0da8aae8%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.