#17582: DoesNotExist ambiguous exception when accessed via foreign key
-------------------------------------+-------------------------------------
Reporter: simon@… | Owner: nobody
Type: | Status: reopened
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 1
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by charettes):
* cc: charettes (added)
* needs_tests: 0 => 1
* version: 1.3 => master
* needs_docs: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Design decision needed => Accepted
Comment:
Accepting the ticket as an improvement.
{{{
#!python
raise self.field.rel.to.DoesNotExist(
"%s has no %s." % (self.field.model.__name__, self.field.name)
)
}}}
''Model has no field.'' sounds better to me but I'd also like comments on
the wording.
I removed the `null` part since this exception can also be raised if the
field as an invalid value as pointed out in comment:3.
This needs testing and an addition to the release note.
--
Ticket URL: <https://code.djangoproject.com/ticket/17582#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].
For more options, visit https://groups.google.com/groups/opt_out.