1. Home
  2. Computer Science MCQs
  3. Django
  4. What happens if Model.objects.get() matches more than one…

Added 2 Nov 2026

What happens if Model.objects.get() matches more than one row?

  1. It silently returns None instead
  2. It raises MultipleObjectsReturned Correct answer
  3. It returns a list of all the rows
  4. It returns the first matching row

Correct answer

B. It raises MultipleObjectsReturned

16 views

MCQSEXAM

Explanation

.get() expects exactly one result: it raises DoesNotExist for zero rows and MultipleObjectsReturned for several. Use filter() when many results are possible.

Reference

Asked in: Python Developer Interviews, NTS

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Django MCQs

Practise all Django MCQs

Similar MCQs