1👍
✅
The views:home
, player
and seasons
are Function Based Views, this is the old Django Views style. On the other hand, ListView
is a Class Based View, a newer way to write views in Django. You are mixing both kind of views and that’s a bad idea. No idea what your season
view should do, but try something like:
def season(request, pk):
season = get_object_or_404(Season, pk=pk)
return render(
request,
'webapp/season.html',
{'season': season, 'players': Player.objects.all()}
)
- Installing weblate 2.3: from django.db.models.sql.aggregates ImportError: No module named aggregates
- Doing a calculation while querying the database in Django
- With uwsgi deployed Django, part css and js can get, others can not
- Trouble finding the right django queryset for this
- ImportError: cannot import name social_auth_usersocialauth: Accessing Python social auth data in django via shell
- 'QuerySet' object has no attribute 'filter_on_search' Python Django
Source:stackexchange.com