πŸ“Š Django
Q. What is the purpose of __str__ method in Django models?
  • (A) Initialize model
  • (B) Return the model id
  • (C) Return a string representation
  • (D) Create a new object
πŸ’¬ Discuss
βœ… Correct Answer: (C) Return a string representation

Explanation: __str__ is used to define the string representation of the model instance.

Explanation by: Rakesh Yadav
__str__ is used to define the string representation of the model instance.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
61
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Rakesh Yadav
Publisher
πŸ“ˆ
96%
Success Rate