from django.db import models from django.conf import settings from django.utils.translation import gettext_lazy as _ class TUGMemberApplication(models.Model): STATUS_PENDING = 0 STATUS_PASS = 1 STATUS_DENY = 2 STATUS_CHOICES = ( (STATUS_PENDING, _('pending')), (STATUS_PASS, _('pass')), (STATUS_DENY, _('deny')), ) real_name = models.CharField(max_length=20) phone = models.CharField(max_length=20) email = models.EmailField() company_name = models.CharField(max_length=30) job_title_code = models.CharField(max_length=64) job_title_text = models.CharField(max_length=64) stage_of_company_use_of_tidb = models.CharField(max_length=64) reason_for_application = models.TextField() preferred_way_of_sharing = models.JSONField(default=list) roles_want_to_play = models.JSONField(default=list) wechat_id = models.CharField(max_length=50) bio = models.TextField(blank=True, null=True) channel = models.CharField(max_length=64, blank=True, null=True) referrer = models.CharField(max_length=32, blank=True, null=True) user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING) status = models.SmallIntegerField(choices=STATUS_CHOICES, default=STATUS_PENDING) reviewer = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING, blank=True, null=True, related_name='reviewd_tug_memeber_applications' ) review_comment = models.TextField(blank=True, null=True) updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) class Meta: db_table = 'pingcap_tug_memeber_applications'