Commit 91fb39ba authored by Jayson Lim's avatar Jayson Lim

Implemented and migrated models

parent bd6a82fe
from django.db import models
from dashboard.models import WidgetUser
# Create your models here.
class Announcement(models.Model):
title = models.CharField(max_length=250, default="")
body = models.TextField(null=True, blank=True)
author = models.ForeignKey(
WidgetUser,
null=True,
default=True,
on_delete=models.SET_DEFAULT
)
pub_datetime = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.title
class Reaction(models.Model):
name = models.CharField(max_length=10, null=False, blank=False)
tally = models.IntegerField(default=0)
annoucement = models.ForeignKey(
Announcement,
null=True,
default=True,
on_delete=models.SET_DEFAULT
)
def __str__(self):
return self.name
\ 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