Update models.py

this change will avoid the error 'expected a character buffer object'