from django.db import models
from django import forms
from django.utils import timezone

# Create your models here.

class Post(models.Model):
    author = models.ForeignKey('auth.User')
    title = models.CharField(max_length=200,default='')
    describe = models.TextField()
    text = models.TextField()
    created_date = models.DateTimeField(default = timezone.now)
    published_date = models.DateTimeField(blank=True,null=True)
    style_id = models.CharField(max_length=100,default='')
    article_count = models.IntegerField(default=0)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __unicode__(self):
        return self.title

class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]
    
704da9ae6c88285ad09c9d29f0f0d38b43aabb37
<mask token>


class Post(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def __unicode__(self):
        return self.title


class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]

<mask token>


class Post(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __unicode__(self):
        return self.title


class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]

<mask token>


class Post(models.Model):
    author = models.ForeignKey('auth.User')
    title = models.CharField(max_length=200, default='')
    describe = models.TextField()
    text = models.TextField()
    created_date = models.DateTimeField(default=timezone.now)
    published_date = models.DateTimeField(blank=True, null=True)
    style_id = models.CharField(max_length=100, default='')
    article_count = models.IntegerField(default=0)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __unicode__(self):
        return self.title


class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]

from django.db import models
from django import forms
from django.utils import timezone


class Post(models.Model):
    author = models.ForeignKey('auth.User')
    title = models.CharField(max_length=200, default='')
    describe = models.TextField()
    text = models.TextField()
    created_date = models.DateTimeField(default=timezone.now)
    published_date = models.DateTimeField(blank=True, null=True)
    style_id = models.CharField(max_length=100, default='')
    article_count = models.IntegerField(default=0)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __unicode__(self):
        return self.title


class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]

from django.db import models
from django import forms
from django.utils import timezone

# Create your models here.

class Post(models.Model):
    author = models.ForeignKey('auth.User')
    title = models.CharField(max_length=200,default='')
    describe = models.TextField()
    text = models.TextField()
    created_date = models.DateTimeField(default = timezone.now)
    published_date = models.DateTimeField(blank=True,null=True)
    style_id = models.CharField(max_length=100,default='')
    article_count = models.IntegerField(default=0)

    def publish(self):
        self.published_date = timezone.now()
        self.save()

    def __unicode__(self):
        return self.title

class Comment(models.Model):
    visitor = models.CharField(max_length=50)
    content = models.TextField()
    published_date = models.DateTimeField(default=timezone.now)
    post = models.ForeignKey('Post')

    def __unicode__(self):
        return self.content[0:20]
    