S
S
Sama Samsonov2017-05-18 06:49:08
Django
Sama Samsonov, 2017-05-18 06:49:08

How can I pass this to the template?

in the old version

from django.views.generic import list_detail, date_based

def post_archive_year(request, year):
    return date_based.archive_year(
        request,
        year=year,
        date_field='published',
        queryset=Post.objects.published(),
    )

how to fix it in the new version?
from django.views.generic.list import ListView

def post_archive_year(request, year):
    return date_based.archive_year(
        request,
        year=year,
        date_field='published',
        queryset=Post.objects.published(),
    )

date_based.archive_year what to write instead of it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question