S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the 'related_name' attribute do in Django model relationships?

  • (A) Specifies the field type
  • (B) Sets a reverse relationship name
  • (C) Changes the field label
  • (D) Sets the database index
  • Correct Answer - Option(B)
  • Views: 4
  • Filed under category Django
  • Hashtags:

Explanation by: Shyam Dubey
related_name sets the name for the reverse relationship from the related model.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.