Commit 5e194148 authored by Norberto Tadeo's avatar Norberto Tadeo 😔

updated forum

parent 8192a742
from django.contrib import admin from django.contrib import admin
from .models import Post
class ForumAdmin(admin.ModelAdmin):
model = Post
search_fields=('pub_date',)
list_display=('pub_date',)
list_filter=('pub_date',)
admin.site.register(Post, ForumAdmin)
# Register your models here. # Register your models here.
# Generated by Django 4.0.3 on 2022-03-18 19:07
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Forum',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('post_title', models.CharField(max_length=50)),
('post_body', models.CharField(max_length=100000)),
('pub_date', models.DateField(auto_now_add=True)),
],
),
]
# Generated by Django 4.0.3 on 2022-03-18 19:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('forum', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Forum',
new_name='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=50)
post_body = models.CharField(max_length=100000)
pub_date = models.DateField(auto_now_add=True)
def __str__(self):
return'{}: {}'.format(self.post_title,self.pub_date)
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