basic app structure setup

This commit is contained in:
CDaut 2022-05-29 18:34:20 +02:00 committed by CDaut
parent 22b616082b
commit be4123361f
11 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,19 @@
from django.db import models
class Tag(models.Model):
name = models.CharField(max_length=255)
class Topic(models.Model):
name = models.CharField(max_length=255)
numbered = models.BooleanField(default=False)
rootTopic = models.ForeignKey('self', blank=True, on_delete=models.CASCADE)
class Blogpost(models.Model):
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, on_delete=models.CASCADE)