1. Home
  2. Computer Science MCQs
  3. Django
  4. What does the extra method do in Django's queryset API?

Added 28 Apr 2024

What does the extra method do in Django's queryset API?

  1. Adds extra SQL clauses to the query Correct answer
  2. Retrieves related objects after the main query is executed
  3. Performs additional filtering on query results
  4. Orders query results in ascending or descending order

Correct answer

A. Adds extra SQL clauses to the query

18 views

MCQSEXAM

Explanation

extra() adds extra SQL clauses to a query — custom SELECT expressions, WHERE conditions or tables.

It is an old escape hatch that Django's documentation now discourages; annotate(), F() expressions and RawSQL are the preferred alternatives.

Keep preparing with more Computer Science MCQs on MCQsExam.com.

Doubts & discussion

Not sure why the answer is A? 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