21 lines
634 B
Python
21 lines
634 B
Python
from django.conf import settings
|
|
from django.db import models
|
|
from oauth2_provider.settings import oauth2_settings
|
|
|
|
from utils.models import BaseModel
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
|
|
class SampleQuerySet(models.QuerySet):
|
|
pass
|
|
|
|
|
|
class Sample(BaseModel):
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT)
|
|
application = models.ForeignKey(oauth2_settings.APPLICATION_MODEL, on_delete=models.PROTECT,
|
|
related_name='+', null=True, blank=True)
|
|
|
|
data = models.JSONField(null=True, blank=True)
|
|
|
|
objects = SampleQuerySet.as_manager()
|