www-bocal/mainsite/context_processors.py
2017-09-22 15:15:05 +02:00

11 lines
266 B
Python

""" Context processors """
from . import models
def sidebar_years(req):
avail_years = models.PublicationYear.objects.all()
publi_years = [year for year in avail_years if len(year.publis()) > 0]
return {
'publication_years': publi_years,
}