old-website/articles/models.py
2023-06-19 19:08:23 +00:00

14 lines
382 B
Python

from django.db import models
class Article(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField()
body = models.TextField()
date = models.DateTimeField(auto_now_add=True)
thumb = models.ImageField(default="default.png", blank=True)
published = models.BooleanField(default=False)
def __str__(self):
return self.title