Fixing views.py to reflect new db sql calls