This repository has been archived on 2022-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
microservices/forum/models.py

25 lines
1.0 KiB
Python
Raw Normal View History

2022-06-20 17:48:20 +02:00
from django.db import models
from django.db import models
from django.contrib.auth.models import User
from django.utils.timezone import now
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE)
image = models.ImageField(upload_to="images",default="default/user.png")
class Post(models.Model):
user1 = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
post_id = models.AutoField
post_content = models.CharField(max_length=5000)
timestamp= models.DateTimeField(default=now)
image = models.ImageField(upload_to="images",default="")
class Reply(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, default=1)
reply_id = models.AutoField
reply_content = models.CharField(max_length=5000)
post = models.ForeignKey(Post, on_delete=models.CASCADE, default='')
timestamp= models.DateTimeField(default=now)
image = models.ImageField(upload_to="images",default="")