Added change to models.py to support Python 3

From here: http://stackoverflow.com/a/22297179/61938

My only concern is I can't test if this breaks backwards compatibility with Python 2.x.