Commit 55e06993 authored by Jersey Dayao's avatar Jersey Dayao 🏀

feat: created Post model in forum app

parent d61633f3
No preview for this file type
from django.contrib import admin from django.contrib import admin
from .models import Post
# Register your models here. # Register your models here.
admin.site.register(Post)
\ No newline at end of file
# Generated by Django 4.0.3 on 2022-03-20 18:30
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('post_title', models.CharField(max_length=100)),
('post_body', models.CharField(max_length=10000)),
('pub_date', models.DateTimeField(verbose_name='date published')),
],
),
]
from django.db import models from django.db import models
# Create your models here. # Create your models here.
class Post(models.Model):
post_title = models.CharField(max_length=100)
post_body = models.CharField(max_length=10000)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.post_title
\ No newline at end of file
...@@ -43,8 +43,9 @@ INSTALLED_APPS = [ ...@@ -43,8 +43,9 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'assignments.apps.AssignmentsConfig', 'assignments.apps.AssignmentsConfig',
'forum', 'forum.apps.ForumConfig',
'homepage', 'homepage',
'announcements'
] ]
MIDDLEWARE = [ MIDDLEWARE = [
......
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