﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30713	ListView queryset issue	Dmitrij Strelnikov	nobody	"Hi guys, 
is this intentional behaviour or not?


{{{
class SomeQuerySet(models.QuerySet):
    def active(self):
        print('active')
        data = cache.get(CACHE_KEY)
        if data is None:
            print('no cache')
            data = self.select_related('related').filter(date_expired__gte=timezone.localtime().now()).filter(
                some__is_active=True).order_by('-date_activated')
            cache.set(CACHE_KEY, data, 30)
        return data

}}}


{{{
class QSSomeListView(ListView):
    queryset = Some.objects.active()
}}}

{{{
class GetQSSomeListView(ListView):
    def get_queryset(self): 
        return Some.objects.active()
}}}

QSSomeListView never print anything from `active()` method on page access, and actually never hit cache. It print only `active` once at project startup.

GetQSSomeListView works as expected.

If its intentional, could you please explain / point me why so?
Thank you."	Bug	closed	Database layer (models, ORM)	2.2	Normal	invalid	queryset		Unreviewed	0	0	0	0	0	0
