#17582: DoesNotExist ambiguous exception when accessed via foreign key
-------------------------------------+-------------------------------------
     Reporter:  simon@…              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  reopened
    Component:  Database layer       |                  Version:  1.3
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Design
     Keywords:                       |  decision needed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by JordanPowell):

 * cc: JordanPowell (added)


Comment:

 Any idea why this is DDN? I can't see any problem with making the
 exception more informative. It looks like someone just forgot to
 instantiate it.

 I'm happy to put together a patch and tests for this, if someone agrees
 that there's no Design Decision Needed.

 I'd probably just change the line to:


 {{{

 raise self.field.rel.to.DoesNotExist(
     "This %s has no %s (the %s is null)" %
     (self.field.model._meta.object_name, self.field.name,
     self.field.rel.to._meta.object_name))

 }}}

 so it reads:

 This Model has no field (the RelatedModel is null).

 Any comments on the wording?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17582#comment:5>
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.


Reply via email to