Pages

What is difference between queryset and get_queryset?

In your example, overriding queryset and get_queryset have the same effect. I would slightly favour setting get_queryset because it's more verbose.
When you set queryset, the queryset is created only once, when you start your server. On the other hand, the get_queryset method is called for every request.
That means that get_queryset is useful if you want to adjust the query dynamically. For example, you could return objects that belong to the current user:
class IndexView(generic.ListView):
    def get_queryset(self):
        """Returns Polls that belong to the current user"""
        return Poll.active.filter(user=self.request.user).order_by('-pub_date')[:5]
Another example where get_queryset is useful is when you want to filter based on a callable, for example, return today's polls:
class IndexView(generic.ListView):
    def get_queryset(self):
        """Returns Polls that were created today"""
        return Poll.active.filter(pub_date=date.today())
If you tried to do the same thing by setting queryset, then date.today() would only be called once, when the view was loaded, and the view would display incorrect results after a while.
class IndexView(generic.ListView):
    # don't do this!
    queryset = Poll.active.filter(pub_date=date.today())

How to enable minimize action on Ubuntu 18.04

This quick tutorial shows you how to enable ‘Minimize on click’, the feather that minimize the running application window when you clicking on the icon in left launcher.
While Settings and Gnome Tweaks utilities do not provide an option to toggle the action, you can enable the feature with Dconf Editor.
1. Search for and install dconf editor in Ubuntu Software:
install-dconf-editor
2. Then launch the tool and navigate to org -> gnome -> shell -> extensions -> dash-to-dock. Scroll download, and click go to settings for click-action.
dconf-clickaction
3. Finally disable default setting and choose “minimize” as its value from drop-down menu:
clickaction-minimize
That’s it.