modified view.py for event related changes