from django.db import models

# Create your models here.
class Blogs(models.Model):
    title = models.TextField(max_length=900)
    image = models.ImageField(upload_to='images/')
    pub_date = models.DateTimeField()
    body = models.TextField(max_length=200)
    
    def __str__(self):
    	return self.title
    def summary(self):
    	return self.body[:100]

    def pub_date_edit(self):
    	return self.pub_date.strftime('%b %e %Y')