Commit 3a589e4c authored by Chino Tesoro's avatar Chino Tesoro

added forum branch and models

parent bdacf657
from django.contrib import admin from django.contrib import admin
# Register your models here. from .models import Post
admin.site.register(Post)
\ No newline at end of file
# Generated by Django 4.0.3 on 2022-03-23 03:24
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=200)),
('post_body', models.CharField(max_length=200)),
('pub_date', models.IntegerField()),
],
),
]
# Generated by Django 4.0.3 on 2022-03-23 06:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('forum', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='post',
name='post_body',
field=models.CharField(max_length=99999),
),
migrations.AlterField(
model_name='post',
name='post_title',
field=models.CharField(max_length=99999),
),
migrations.AlterField(
model_name='post',
name='pub_date',
field=models.DateTimeField(verbose_name='date published'),
),
migrations.CreateModel(
name='Reaction',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('reaction_name', models.CharField(max_length=99999)),
('tally', models.IntegerField()),
('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forum.post')),
],
),
]
from django.db import models from django.db import models
# Create your models here. class Post (models.Model):
post_title = models.CharField(max_length=99999)
post_body = models.CharField(max_length=99999)
pub_date = models.DateTimeField("date published")
class Reaction (models.Model):
post = models.ForeignKey(Post, on_delete=models.CASCADE)
reaction_name = models.CharField(max_length=99999)
tally = models.IntegerField(default=0)
\ No newline at end of file
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