diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index c348db182b..45c4f2f5d0 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1624,6 +1624,11 @@ The :exc:`~django.db.models.Model.DoesNotExist` exception inherits from except ObjectDoesNotExist: print("Either the entry or blog doesn't exist.") +If you expect a queryset to return one row, you can use ``get()`` without any +arguments to return the object for that row:: + + entry = Entry.objects.filter(...).exclude(...).get() + ``create()`` ~~~~~~~~~~~~