fix: resolved conflict of null id by declaring that the id is null in models of forum app

parent 47309748
......@@ -3,12 +3,12 @@ from homepage.models import WidgetUser
# Create your models here.
class Post(models.Model):
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=True)
post_title = models.CharField(max_length=100)
post_body = models.CharField(max_length=1000)
pub_date = models.DateTimeField("Date published")
class Reply(models.Model):
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=True)
reply_body = models.CharField(max_length=1000)
pub_date = models.DateTimeField("Replied on")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment