made production changes and added post user foreign key relation
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user