In Django QuertSet, which method is used to get the specified column?

31. In Django QuertSet, which method is used to get the specified column?

  1. column_values()
  2. columnvalues()
  3. values_list()
  4. column_list()

Answer: C) values_list()

Explanation:

In Django QuertSet, the values_list() method is used to get the specified column. Consider the below code statement –

dataObj = students.objects.values_list('class')

Where, "students" is the model name, and "class" is the column name.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.