mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-15 06:07:41 +03:00
20 lines
422 B
Python
20 lines
422 B
Python
|
from django.db import models
|
||
|
|
||
|
class BaseToken(models.Model):
|
||
|
"""
|
||
|
The base abstract authorization token model class.
|
||
|
"""
|
||
|
key = models.CharField(max_length=32, primary_key=True)
|
||
|
user = models.ForeignKey('auth.User')
|
||
|
revoked = models.BooleanField(default=False)
|
||
|
|
||
|
class Meta:
|
||
|
abstract=True
|
||
|
|
||
|
|
||
|
class Token(BaseToken):
|
||
|
"""
|
||
|
The default authorization token model class.
|
||
|
"""
|
||
|
pass
|