Commit c04dd753 authored by Titia de Castro's avatar Titia de Castro

added author field and __str__ method to Announcement model

parent fca54638
from django.db import models from django.db import models
from homepage.models import WidgetUser
class Announcement(models.Model): class Announcement(models.Model):
announcement_title = models.CharField(max_length=200) announcement_title = models.CharField(max_length=200)
announcement_body = models.TextField() announcement_body = models.TextField()
pub_date = models.DateField(auto_now_add=True) pub_date = models.DateField(auto_now_add=True)
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=True)
def __str__(self):
return self.announcement_title
class Reaction(models.Model): class Reaction(models.Model):
class ReactionNames(models.TextChoices): class ReactionNames(models.TextChoices):
......
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