Commit 44563c50 authored by Norberto Tadeo's avatar Norberto Tadeo 😔

Merge branch 'Forum' into 'master'

changed minor lines in models.py, removed some lines

See merge request !8
parents 5c8dd855 953b5f8c
...@@ -5,17 +5,16 @@ class Post(models.Model): ...@@ -5,17 +5,16 @@ class Post(models.Model):
post_title = models.CharField(max_length=50) post_title = models.CharField(max_length=50)
post_body = models.CharField(max_length=100000) post_body = models.CharField(max_length=100000)
pub_date = models.DateField(auto_now_add=True) pub_date = models.DateField(auto_now_add=True)
author = models.ForeignKey(WidgetUser, null = True, on_delete=models.CASCADE, default = "Anonymous") author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, default = None)
def __str__(self): def __str__(self):
return'{}: {}'.format(self.post_title,self.pub_date) return'{}: {}'.format(self.post_title,self.pub_date)
class Reply(models.Model): class Reply(models.Model):
post = models.ForeignKey(Post, null = True, on_delete=models.CASCADE, default = None) post = models.ForeignKey(Post, on_delete=models.CASCADE, default = None)
reply_body = models.CharField(max_length=100000) reply_body = models.CharField(max_length=100000)
pub_date = models.DateField(auto_now_add=True) pub_date = models.DateField(auto_now_add=True)
author = models.ForeignKey(WidgetUser, null = True, on_delete=models.CASCADE, default ='Anonymous') author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, default = None)
active = models.BooleanField(default=True)
def __str__(self): def __str__(self):
if len(self.reply_body) >= 50: if len(self.reply_body) >= 50:
......
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