from django.db import models
from utils.model import SoftModel, BaseModel
from apps.system.models import CommonAModel, CommonBModel, User
# Create your models here.

class BaseInfo(CommonBModel):
    
    gender_choices = (
        ('男', '男'),
        ('女', '女'),
    )

    user = models.OneToOneField(User, on_delete=models.CASCADE, null=True, blank=True, verbose_name="关联账户")
    name = models.CharField(verbose_name="姓名", max_length=100)
    gender = models.CharField(verbose_name="性别",choices=gender_choices, default='男', max_length=10)
    idnumber = models.CharField(verbose_name="身份证号", max_length=40)
    paddress = models.TextField(verbose_name="通讯地址")
    photo = models.CharField(verbose_name="证件照", max_length=100, null=True, blank=True)

    class Meta:
        verbose_name = '专家基本信息'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name

class WorkExperience(CommonAModel):
    
    name = models.CharField(verbose_name="单位名", max_length=100)
    class Meta:
        verbose_name = '专家工作经历'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name

class Project(CommonAModel):
    
    name = models.CharField(verbose_name="名称", max_length=100)
    class Meta:
        verbose_name = '专家项目'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name

class Paper(CommonAModel):
    
    name = models.CharField(verbose_name="名称", max_length=100)
    class Meta:
        verbose_name = '专家论文/著作'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name


class Award(CommonAModel):

    name = models.CharField(verbose_name="名称", max_length=100)
    class Meta:
        verbose_name = '专家获奖/荣誉'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name