mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
imported and updated to contrib auth User model
This commit is contained in:
parent
7dca49cb18
commit
45e38ddacc
|
@ -1,7 +1,7 @@
|
||||||
import binascii
|
import binascii
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from django.conf import AUTH_USER_MODEL
|
from django.contrib.auth.models import User
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
from django.utils.encoding import python_2_unicode_compatible
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
@ -14,7 +14,7 @@ class Token(models.Model):
|
||||||
"""
|
"""
|
||||||
key = models.CharField(_("Key"), max_length=40, primary_key=True)
|
key = models.CharField(_("Key"), max_length=40, primary_key=True)
|
||||||
user = models.OneToOneField(
|
user = models.OneToOneField(
|
||||||
AUTH_USER_MODEL, related_name='auth_token',
|
User, related_name='auth_token',
|
||||||
on_delete=models.CASCADE, verbose_name=_("User")
|
on_delete=models.CASCADE, verbose_name=_("User")
|
||||||
)
|
)
|
||||||
created = models.DateTimeField(_("Created"), auto_now_add=True)
|
created = models.DateTimeField(_("Created"), auto_now_add=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user