Commit 489cb54a authored by Vaughn Fajardo's avatar Vaughn Fajardo

fix: resolved some bugs

parents 7854cc95 bafa5a67
No preview for this file type
from django.contrib import admin from django.contrib import admin
from .models import Post from .models import Post
from .models import Reply
# Register your models here. # Register your models here.
admin.site.register(Post) admin.site.register(Post)
admin.site.register(Reply)
\ No newline at end of file
# Generated by Django 4.0.3 on 2022-03-30 08:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0003_remove_widgetuser_department_department_department_and_more'),
('forum', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='author',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
migrations.CreateModel(
name='Reply',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reply_body', models.CharField(max_length=1000)),
('pub_date', models.DateTimeField(verbose_name='Replied on')),
('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser')),
],
),
]
from django.db import models from django.db import models
from homepage.models import WidgetUser
# Create your models here. # Create your models here.
class Post(models.Model): class Post(models.Model):
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=True)
post_title = models.CharField(max_length=100) post_title = models.CharField(max_length=100)
post_body = models.CharField(max_length=1000) post_body = models.CharField(max_length=1000)
pub_date = models.DateTimeField("Date published") pub_date = models.DateTimeField("Date published")
class Reply(models.Model):
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE, null=True)
reply_body = models.CharField(max_length=1000)
pub_date = models.DateTimeField("Replied on")
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