Google News
logo
Django - Quiz(MCQ)
A)
User.object.all()
B)
User.all_records()
C)
Users.objects.all()
D)
User.objects.all()

Correct Answer : Option (D) :   User.objects.all()

A)
TRUE
B)
FALSE
C)
None of the above
D)

Correct Answer : Option (A) :   TRUE


Explanation : True, In Django, views have to be created in the app views.py file.

A)
2
B)
3
C)
4
D)
5

Correct Answer : Option (B) :   3


Explanation : This function takes three parameters : Request, The path to the template and Dictionary of parameters.

4 .
Suppose you want to count the number of books in Django.Which implementation would be fastest?
 
books = Book.objects.all()
A)
Python Implementation – len(books)
B)
Database level Implementation – books.count()
C)
Template Language Implementation – {{ books | length }}
D)
None of the above

Correct Answer : Option (B) :   Database level Implementation – books.count()


Explaination : Database level Implementation – books.count() implementation would be fastest.