Added change to models.py to support Python 3

From here: http://stackoverflow.com/a/22297179/61938

I'm not sure if this breaks backwards compatibility with Python 2.x, and if you care or not :)