Commit 53af0f91 authored by Eury See's avatar Eury See

Implemented and populated the Admin pages for the Forum application.

parent 02e2337a
from django.contrib import admin
from .models import ForumPost
from .models import Reply
# Register your models here.
class ForumPostAdmin(admin.ModelAdmin):
model = ForumPost
list_display = ("title", "body", "author", "pub_datetime",)
class ReplyAdmin(admin.ModelAdmin):
model = Reply
list_display = ("body", "author", "pub_datetime",)
admin.site.register(ForumPost, ForumPostAdmin)
admin.site.register(Reply, ReplyAdmin)
\ No newline at end of file
# Generated by Django 4.1.7 on 2023-03-05 18:34
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ForumPost',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('body', models.TextField()),
('author', models.CharField(max_length=50)),
('pub_datetime', models.DateTimeField()),
],
),
migrations.CreateModel(
name='Reply',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('body', models.TextField()),
('author', models.CharField(max_length=50)),
('pub_datetime', models.DateTimeField()),
('reply_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Forum.forumpost')),
],
),
]
No preview for this file type
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