2018-12-26 02:00:22 +00:00
|
|
|
import uuid
|
|
|
|
|
|
|
|
from django.contrib.auth.models import AbstractUser, User
|
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
# Create your models here.
|
|
|
|
class YearRange(models.Model):
|
|
|
|
id = models.UUIDField('id',primary_key=True,default=uuid.uuid4)
|
2018-12-26 10:52:34 +00:00
|
|
|
user = models.ForeignKey(User,blank=False,null=False,on_delete=models.CASCADE)
|
|
|
|
start_year = models.CharField('起始年份',max_length=256)
|
|
|
|
end_year = models.CharField('截止年份',max_length=256)
|
2018-12-26 02:00:22 +00:00
|
|
|
|
2018-12-27 10:11:59 +00:00
|
|
|
def __str__(self):
|
|
|
|
return str(self.user)
|
2018-12-26 02:00:22 +00:00
|
|
|
|