diff options
Diffstat (limited to 'docs/ref/models/fields.txt')
-rw-r--r-- | docs/ref/models/fields.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 4acf47c188..03b713704b 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -1894,14 +1894,16 @@ your resulting ``User`` model will have the following attributes:: >>> hasattr(user, 'supervisor_of') True -A ``DoesNotExist`` exception is raised when accessing the reverse relationship -if an entry in the related table doesn't exist. For example, if a user doesn't -have a supervisor designated by ``MySpecialUser``:: +A ``RelatedObjectDoesNotExist`` exception is raised when accessing the reverse +relationship if an entry in the related table doesn't exist. This is a subclass +of the target model's :exc:`Model.DoesNotExist +<django.db.models.Model.DoesNotExist>` exception. For example, if a user +doesn't have a supervisor designated by ``MySpecialUser``:: >>> user.supervisor_of Traceback (most recent call last): ... - DoesNotExist: User matching query does not exist. + RelatedObjectDoesNotExist: User has no supervisor_of. .. _onetoone-arguments: |