from django.db import models

# Create your models here.
class Article(models.Model):
    title =models.CharField(max_length=100) #博客题目，商品名称
    category = models.CharField(max_length=50,blank= True) #博客标签
    date_time = models.DateTimeField(auto_now_add= True) #博客日期
    content = models.TextField(blank= True,null= True) #博客文章正文，商品简介
    def __unicode__(self):
        return  self.title
    class Meta: #按时间下降排序
        ordering = ['-date_time']

#class ArticleAdmin(admin.ModelAdmin):
 #   list_display = ('title','date_time')
