old-website/articles/models.py

14 lines
382 B
Python
Raw Normal View History

2023-06-18 18:06:01 +00:00
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)
2023-06-19 16:48:32 +00:00
thumb = models.ImageField(default="default.png", blank=True)
2023-06-18 18:06:01 +00:00
published = models.BooleanField(default=False)
def __str__(self):
return self.title