Commit 56ef1a29 authored by Michael Lopez's avatar Michael Lopez

Populated the models Announcement and Reaction with 3 records each....

Populated the models Announcement and Reaction with 3 records each. Additionally, changed '.models' to 'dashboard.models' in announcements models.py
parent 7017269f
# Generated by Django 4.1.7 on 2023-03-05 09:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('dashboard', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Announcement',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=50)),
('body', models.TextField(max_length=1024)),
('pub_datetime', models.DateTimeField()),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dashboard.widgetuser')),
],
),
migrations.CreateModel(
name='Reaction',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(choices=[('like', 'Like'), ('love', 'Love'), ('angry', 'Angry')], default='like', max_length=5)),
('tally', models.IntegerField()),
('announcement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='announcements.announcement')),
],
),
]
from django.db import models
from .models import WidgetUser
from dashboard.models import WidgetUser
class Announcement(models.Model):
title = models.CharField(max_length=50)
......@@ -21,7 +21,7 @@ class Reaction(models.Model):
(ANGR, 'Angry')
]
name = models.CharField(
max_length=4,
max_length=5,
choices=namechoices,
default=LIKE
)
......
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