#10227: OneToOne fields with null=True raise DoesNotExist exception on related
model
-------------------------------------+-------------------------------------
Reporter: rvdrijst | Owner: nobody
Type: New | Status: new
feature | Component: Database layer
Milestone: | (models, ORM)
Version: SVN | Severity: Normal
Resolution: | Keywords: onetoone related
Triage Stage: Accepted | expection null
Needs documentation: 0 | Has patch: 0
Patch needs improvement: 0 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Comment (by olau):
Rereading this, can I suggest that related_default does not have to be a
function? It would make things a bit clearer if one could say
related_default=None instead =lambda x: None.
I realize this means you have to apply slight cleverness when defining the
parameter since you can't use None, e.g.
{{{
class RelatedDefaultRaiseException: pass
def __init__(..., related_default=RelatedDefaultRaiseException):
if related_default == RelatedDefaultRaiseException:
# turn on exception raising behaviour
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/10227#comment:15>
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.