working on converting all django ORM calls and python to raw SQL queries