Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Geoff L
Geoff L
11,756 Points

Where did performer.song_set come from?

The karaoke testing was very difficult as the main issue i had was finding out i had to add performer.song_set to the performer_detail.html file.

Where was this covered? This was not at all clear on how to use or that it was necessary to use. I have a feeling this is why so many people are not able to finish this testing challenge. I was only able to find out by combing through everyone else's examples.

Is this just a special feature due to using performer = models.ForeignKey('Performer') in the Song class?

This is what i ended up finding from other's work:

performer_detail.html
{% extends 'base.html' %}

{% block title %}{{ performer.name }}{% endblock %}

{% block content %}
<h2>{{ performer.name }}</h2>
{{ performer.song_set.all|safe|linebreaks }}
{% endblock %}

I believe Kenneth vaguely mentions this in the video 'Step Detail View' section. Thank you in advance, I am just trying to understand this concept.

Geoff L
Geoff L
11,756 Points

Hi Megan, This challenge was part of the Django basics Testing Time challenge: django-basics/test-time/django-tdd

After re watching several videos I believe the topic was lightly mentioned in this video: django-basics/final-details/step-detail-view