# Path: doac/conf.py
# class Settings:
#     def __init__(self, options):
#     def setup_access_token(self):
#     def setup_auth_code(self):
#     def setup_auth_token(self):
#     def setup_client(self):
#     def setup_refresh_token(self):
# 
# Path: doac/compat.py
# def get_user_model():
#     """
#     Get the user model that is being used.  If the `get_user_model` method
#     is not available, default back to the standard User model provided
#     through `django.contrib.auth`.
#     """
# 
#     try:
#         from django.contrib.auth import get_user_model
#         
#         return get_user_model()
#     except ImportError:
#         from django.contrib.auth.models import User
#         
#         return User


from django.db import models
from django.utils.translation import ugettext_lazy as _
from .conf import options
from .compat import get_user_model
from . import managers
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import get_random_string
        from .compat import now


user_model = get_user_model()


AUTO_GENERATION_HELP_TEXT = _(u'Leave blank to have it automatically generated.')


class AccessToken(models.Model):
    user = models.ForeignKey(user_model, related_name="access_tokens")
    client = models.ForeignKey("Client", related_name="access_tokens")

    refresh_token = models.ForeignKey("RefreshToken", related_name="access_tokens")
    token = models.CharField(
        max_length=options.access_token["length"],
        blank=True,
        help_text=AUTO_GENERATION_HELP_TEXT,
    )
    scope = models.ManyToManyField("Scope", related_name="access_tokens")

    created_at = models.DateTimeField(auto_now_add=True)
    expires_at = models.DateTimeField()
    is_active = models.BooleanField(default=True)

    objects = managers.AccessTokenManager()


# Path: doac/conf.py
# class Settings:
#     def __init__(self, options):
#     def setup_access_token(self):
#     def setup_auth_code(self):
#     def setup_auth_token(self):
#     def setup_client(self):
#     def setup_refresh_token(self):
# 
# Path: doac/compat.py
# def get_user_model():
#     """
#     Get the user model that is being used.  If the `get_user_model` method
#     is not available, default back to the standard User model provided
#     through `django.contrib.auth`.
#     """
# 
#     try:
#         from django.contrib.auth import get_user_model
#         
#         return get_user_model()
#     except ImportError:
#         from django.contrib.auth.models import User
#         
#         return User


# Path: doac/models.py
from django.db import models
from django.utils.translation import ugettext_lazy as _
from .conf import options
from .compat import get_user_model
from . import managers
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import now
        from .compat import get_random_string
        from .compat import get_random_string
        from .compat import now



user_model = get_user_model()


AUTO_GENERATION_HELP_TEXT = _(u'Leave blank to have it automatically generated.')


class AccessToken(models.Model):
    user = models.ForeignKey(user_model, related_name="access_tokens")
    client = models.ForeignKey("Client", related_name="access_tokens")

    refresh_token = models.ForeignKey("RefreshToken", related_name="access_tokens")
    token = models.CharField(
        max_length=options.access_token["length"],
        blank=True,
        help_text=AUTO_GENERATION_HELP_TEXT,
    )
    scope = models.ManyToManyField("Scope", related_name="access_tokens")

    created_at = models.DateTimeField(auto_now_add=True)
    expires_at = models.DateTimeField()
    is_active = models.BooleanField(default=True)

    objects = managers.AccessTokenManager()


    def __unicode__(self):