made production changes and added post user foreign key relation

This commit is contained in:
Alexander Schulz
2024-08-30 17:52:52 +02:00
parent 014b3995ae
commit 144263cf8c
132 changed files with 27 additions and 31853 deletions

View File

@ -1,4 +1,5 @@
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Post(models.Model):
@ -7,6 +8,7 @@ class Post(models.Model):
slug = models.SlugField()
date = models.DateTimeField(auto_now_add=True)
banner = models.ImageField(default='fallback.png', blank=True)
author = models.ForeignKey(User, on_delete=models.CASCADE, default=None) #Kritisch wenn conus medical products are linked to User.objects.get(username='root')company and compony is deleted all products are deleted.
def __str__(self):
return self.title