A lot of the time, I see this:
def get_queryset(self):
queryset = super(SomeView, self).get_queryset()
return queryset.filter(published=True)
This is typical in a Django class based view. What I'd like to know are, why do we do this, when we can just do this:
queryset = someModel.objects.all().filter(args)
Or if you prefer two lines (or you think I just like one liners, which is not the case here):
all_the_stuff = someModel.objects.all()
the_stuff_we_want = all_the_stuff.filter(...)
Also, how does the logic behind the super() call exactly work, because I simply don't get it. Any link to some good documentation explaining this would be highly appreciated, and why use it, when the second example is so much more understandable.