Commit 225847b0 authored by Ron Rodillas's avatar Ron Rodillas

Created the models and admin panel for the forum app

parent eb1ef2f3
from django.contrib import admin
from .models import ForumPost, Reply
# Register your models here.
class ForumPostAdmin(admin.ModelAdmin):
model = ForumPost
list_display = ('title', 'author', 'pub_datetime')
search_fields = ('title', 'author')
list_filter = ('pub_datetime')
class ReplyAdmin(admin.ModelAdmin):
model = Reply
list_display = ('author', 'pub_datetime')
search_fields = ('author')
list_filter = ('pub_datetime')
\ No newline at end of file
from django.apps import AppConfig
class ForumConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'forum'
from django.db import models
# Create your models here.
class ForumPost (models.model):
title = models.CharField(max_length=100)
body = models.TextField()
author = models.CharField(max_length=100)
pub_datetime = models.DateTimeField(auto_now_add=True)
class Reply (models.model):
body = models.TextField()
author = models.CharField(max_length=100)
pub_datetime = models.DateTimeField(auto_now_add=True)
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
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