This commit is contained in:
Xavier Ordoquy 2013-10-22 02:14:20 -07:00
commit 15cffee23f

View File

@ -4,8 +4,10 @@ from hashlib import sha1
from rest_framework.compat import AUTH_USER_MODEL from rest_framework.compat import AUTH_USER_MODEL
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Token(models.Model): class Token(models.Model):
""" """
The default authorization token model. The default authorization token model.
@ -31,5 +33,5 @@ class Token(models.Model):
unique = uuid.uuid4() unique = uuid.uuid4()
return hmac.new(unique.bytes, digestmod=sha1).hexdigest() return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
def __unicode__(self): def __str__(self):
return self.key return self.key