from django.db import models

from start.models import Searchable

class Category(models.Model):
    """
    A category of blog posts
    """
    name = models.CharField(max_length=50)
    slug = models.SlugField()

class BlogPost(Searchable):
    """
    Should contain a blogpost
    """
    body = models.TextField()
    category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True)
    thumbnail = models.ImageField(blank=True)
    public = models.BooleanField(default=True)
    slug = models.SlugField()
