# coding=utf-8

from django.db import models
from django.conf import settings

from apps.images.models import Images


class Activity(models.Model):
    title = models.CharField(verbose_name=u'标题', max_length=255)
    end_date = models.DateField(verbose_name=u"截止日期")
    describe = models.TextField(verbose_name=u'活动介绍')
    cover = models.ForeignKey(Images, verbose_name=u'封面', on_delete=models.PROTECT, related_name=u'activity_cover', null=True)
    notes = models.CharField(max_length=500, verbose_name=u"备注", blank=True, null=True)

    create_user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=u'创建人', editable=False, on_delete=models.PROTECT)
    create_time = models.DateTimeField(verbose_name=u"添加时间", auto_now_add=True, editable=False)

    delete = models.BooleanField(verbose_name=u"删除", default=False, editable=False)

    class Meta:
        db_table = "activity"
        verbose_name = u"活动"
        ordering = ['-id']
        default_permissions = ()
