Commit b6c8ed31 authored by Bryan Carlo Guanlao's avatar Bryan Carlo Guanlao

added and populated announcement model

parent ee5a9cca
from django.contrib import admin
# Register your models here.
from .models import Announcement
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
list_display = ('announcement_title', 'pub_date')
admin.site.register(Announcement, AnnouncementAdmin)
from tabnanny import verbose
from django.apps import AppConfig
......
# Generated by Django 3.2.12 on 2022-03-22 18:58
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Announcement',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('announcement_title', models.CharField(max_length=50)),
('announcement_body', models.TextField(max_length=500)),
('pub_date', models.DateField(auto_now_add=True)),
],
),
]
from django.db import models
# Create your models here.
class Announcement(models.Model):
announcement_title = models.CharField(max_length=50)
announcement_body = models.TextField(max_length=500)
pub_date = models.DateField(auto_now_add=True)
def __str__(self):
return '{}'.format(self.announcement_title)
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