26 lines
983 B
Python
26 lines
983 B
Python
from django.db import models
|
|
|
|
from common.models.baseModels import BaseModel
|
|
from common.models.choiceModels import CertificateCodeUseType, InviteCodeUseType
|
|
from common.utils.codeManger import set_expire
|
|
|
|
# from django.contrib.contenttypes.fields import GenericForeignKey
|
|
# from django.contrib.contenttypes.models import ContentType
|
|
|
|
# from projects.models import Project
|
|
|
|
|
|
class CertificationCode(BaseModel):
|
|
use_type = models.CharField(choices=CertificateCodeUseType.choices, max_length=5)
|
|
code = models.CharField(max_length=6)
|
|
expire_at = models.DateTimeField(default=set_expire)
|
|
is_used = models.BooleanField(default=False)
|
|
identifier = models.CharField(max_length=40)
|
|
|
|
class InviteCode(BaseModel):
|
|
use_type = models.CharField(choices=InviteCodeUseType.choices, max_length=5)
|
|
code = models.CharField(max_length=10)
|
|
expire_at = models.DateTimeField(default=set_expire) # 일주일은 10080분
|
|
identifier = models.CharField(max_length=40)
|
|
|