#10227: OneToOne fields with null=True raise DoesNotExist exception on related model -------------------------------------+------------------------------------- Reporter: rvdrijst | Owner: nobody Type: New feature | Status: new Component: Database layer | Version: SVN (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: onetoone related | Needs documentation: 0 expection null | Patch needs improvement: 0 Has patch: 0 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by sebastian):
* cc: sebastian (added) Comment: I'd also like to see the functionality of the reverse side not throwing an exception. This would also make both sides of the one-to-one relation behave more symmetric. I agree that an additional parameter is the way to go, since all four types of blank/non-blank make sense (comment:7). Can gsakkis' snippet (comment:10) be adapted to the current trunk version? I agree that passing `None` or constant values to `related_default` should be possible in addition to passing in functions/lambdas, as it makes the model definition much cleaner in the case of simple values. -- Ticket URL: <https://code.djangoproject.com/ticket/10227#comment:17> 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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.