Commit 02e2337a authored by Eury See's avatar Eury See

Implemented models for the Forum application.

parent 4553fdab
from django.db import models
# Create your models here.
class ForumPost(models.Model):
title = models.CharField(max_length = 100)
body = models.TextField()
author = models.CharField(max_length = 50)
pub_datetime = models.DateTimeField()
def __str__(self):
return self.title
class Reply(models.Model):
body = models.TextField()
author = models.CharField(max_length = 50)
pub_datetime = models.DateTimeField()
reply_to = models.ForeignKey(ForumPost, on_delete=models.CASCADE)
def __str__(self):
return self.body
No preview for this file type
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