Commit 6d0d3258 authored by Charles Lim's avatar Charles Lim

Added image field to announcement model

parent 3736d8fc
# Generated by Django 4.0.4 on 2022-05-19 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('announcement_board', '0003_alter_announcement_pub_date'),
]
operations = [
migrations.AddField(
model_name='announcement',
name='announcement_pic',
field=models.FileField(blank=True, null=True, upload_to='uploads'),
),
]
...@@ -6,6 +6,8 @@ class Announcement(models.Model): ...@@ -6,6 +6,8 @@ class Announcement(models.Model):
announcement_body = models.TextField(blank=True) announcement_body = models.TextField(blank=True)
pub_date = models.DateField("date published") pub_date = models.DateField("date published")
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, default=1) author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, default=1)
announcement_pic = models.FileField(
upload_to="uploads", null=True, blank=True)
def __str__(self): def __str__(self):
return self.announcement_title return self.announcement_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