S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the __str__ method in a Django model do?

  • (A) Specifies model name
  • (B) Returns a string representation of an object
  • (C) Returns the table name
  • (D) Displays the ID
  • Correct Answer - Option(B)
  • Views: 15
  • Filed under category Django
  • Hashtags:

Explanation by: Shyam Dubey
The __str__ method returns a human-readable string representation of an object.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.