1 # -*- coding: utf-8 -*-
2 # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
5 from migdal.models import Entry
6 from migdal.settings import TYPES
7 from django.utils.translation import get_language
10 def entry_list(entry_type=None, category=None):
12 object_list = Entry.objects.filter(**{"published_%s" % lang: True})
14 object_list = object_list.filter(type=entry_type.db)
16 object_list = object_list.filter(type__in=[t.db for t in TYPES if t.on_main])
18 object_list = object_list.filter(categories=category)