Adding sorting feature in the views.py