Updated class Announcement

parent ec0eb2ec
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from dashboard.models import WidgetUser
Like = 'Like' Like = 'Like'
Love = 'Love' Love = 'Love'
...@@ -10,10 +11,10 @@ REACTIONS = ((Like, 'Like'), ...@@ -10,10 +11,10 @@ REACTIONS = ((Like, 'Like'),
class Announcement(models.Model): class Announcement(models.Model):
title = models.CharField(max_length=50) title = models.CharField(max_length=100)
body = models.TextField(max_length=10000) body = models.TextField(max_length=10000)
author = models.CharField(max_length=100) author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
pub_datetime = models.DateTimeField("date published", default=timezone.now, null=True) pub_datetime = models.DateTimeField(default=timezone.now, null=True, blank=True, default=None)
def __str__(self): def __str__(self):
return self.title return self.title
......
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