1👍
✅
Based on your urls.py
, you have two options for the URL:
Call series:season
with just the series ID (url(r'^(?P<serie_id>[0-9]+)/$', views.season, name='season')
):
<ul>
{% for season in season_list %}
<li><a href="{% url 'series:season' series.id %}">{{ season.season_name }}</a></li>
{% endfor %}
</ul>
or call series:chapter
(url(r'^(?P<serie_id>[0-9]+)/(?P<season_id>[0-9]+)/$', views.chapter, name='chapter')
) with the series ID and season ID – I don’t know where series
comes from, so you need to modify this code before it will work.
<ul>
{% for season in season_list %}
<li><a href="{% url 'series:chapter' series.id season.id %}">{{ season.season_name }}</a></li>
{% endfor %}
</ul>
Source:stackexchange.com