began adding addpost function

This commit is contained in:
CDaut 2022-06-02 08:29:52 +02:00 committed by CDaut
parent 81c455f014
commit c50d047233
15 changed files with 106 additions and 21 deletions

View file

@ -16,8 +16,13 @@ class Topic(models.Model):
class Blogpost(models.Model):
def __str__(self) -> str:
return str(self.title)
created = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)
title = models.CharField(max_length=255)
tags = models.ManyToManyField(Tag)
topics = models.ForeignKey(Topic, blank=True, null=True, on_delete=models.CASCADE)
topic = models.ForeignKey(Topic, blank=True, null=True, on_delete=models.CASCADE)
mdfile = models.CharField(max_length=255)