Update models.py

Compatibility with python3