feat: added the Reply model and registered it to Django admin

parent 200e09d7
from django.contrib import admin
from .models import Post
from .models import Post, Reply
# Register your models here.
admin.site.register(Post)
\ No newline at end of file
admin.site.register(Post)
admin.site.register(Reply)
\ No newline at end of file
......@@ -2,6 +2,12 @@ from django.db import models
# Create your models here.
class Post(models.Model):
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
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)
reply_body = models.CharField(max_length=1000)
pub_date = models.DateTimeField("Replied on")
\ No newline at end of file
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