g214/news/models.py

27 lines
985 B
Python

#coding:utf-8
from __future__ import unicode_literals
import uuid
from django.db import models
class News(models.Model):
CATEGORY_CHOICES = ((1, u'新闻动态'),
(2, u'通知公告'),
(3, u'科技交流'),
)
id = models.UUIDField('id', primary_key=True, default=uuid.uuid4)
created = models.DateField(u'创建日期')
updated = models.DateField(u'更新日期', auto_now=True)
category = models.IntegerField(u'分类', choices=CATEGORY_CHOICES)
title = models.CharField(u'标题', max_length=256, default='')
author = models.CharField(u'作者', max_length=256, default=u'系统管理员')
source = models.CharField(u'来源', max_length=256, default=u'系统管理员')
hit_count = models.IntegerField(u'点击数', blank=True)
content = models.TextField(u'内容')
def __unicode__(self):
return self.title
class Meta:
verbose_name_plural=u'工作动态'