#25160: Move unsaved model instance assignment check to model.save()
-------------------------------------+-------------------------------------
Reporter: timgraham | Owner: timgraham
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: 1.8
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by tobiasmcnulty):
+1 to this change as well. I discovered we were using related model
objects for unsaved data while upgrading an old project and stumbled
through several different options as workarounds before eventually
settling on this: https://www.caktusgroup.com/blog/2015/07/28/using-
unsaved-related-models-sample-data-django-18/
So, if you don't happen to backport to 1.8, there is a workaround, but in
the end I do think it makes a lot more sense to validate this in save()
rather then at the time of assignment.
--
Ticket URL: <https://code.djangoproject.com/ticket/25160#comment:6>
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/067.478172aedb54b4600ba29b4ee46c251c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.