Answer the question
In order to leave comments, you need to log in
Django QuerySet how to filter?
Created a model with movie sessions.
In views.py created a handler
def index(request):
posts = Show.objects.all()
context = {
'posts': posts,
'menu': menu,
'title': 'Главная страница',
'cat_selected': 0,
}
return render(request, 'movie/index.html', context=context)
{% for p in posts %}
Год: {{p.movie.year}}
Жанр: {{p.movie.genre}}
Время показа 1: {{p.show.time}}
Время показа 2: {{p.show.time}}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question