#24395: Cannot reference FK relation from inline ModelForm.save()
---------------------------------+-------------------------------------
Reporter: Starou | Owner: timgraham
Type: Bug | Status: assigned
Component: Forms | Version: 1.8alpha1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Comment (by Starou):
Maybe your release notes update from ticket #24325 is not relevant anymore
?
https://github.com/django/django/commit/8657e7caaac41266d9ac0b73a21af64edc681613
{{{
+Now if the related instance hasn't been saved (for example, when adding
an
+author and some inlined books in the admin), accessing the foreign key
+``book.author`` in the example) will raise ``RelatedObjectDoesNotExist``.
}}}
The example is not true, I think the related was saved in the admin.
But before the patch, although it was saved, you'd get the exception as
described.
With the patch, the instance is saved and now accessible in Form.save().
Concerning the documentation, I can't see what we can add unless the
previous behaviour was documented.
--
Ticket URL: <https://code.djangoproject.com/ticket/24395#comment:9>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.7cc6f9389020b74443d8c8b74569f787%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.