updating model.py for pg databse