Updated models.py and admin.py

parent 4bc2bd74
from django.contrib import admin from django.contrib import admin
# Register your models here. from .models import Announcement
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
admin.site.register(Announcement, AnnouncementAdmin)
\ No newline at end of file
from django.db import models from django.db import models
class Announcement(models.Model): class Announcement(models.Model):
announcement_title = models.CharField(max_length=100) announcement_title = models.CharField(max_length=50)
announcement_body = models.CharField(max_length=400) announcement_body = models.CharField(max_length=400)
pub_date = models.DateField(auto_now_add = True) pub_date = models.DateField(auto_now_add=True)
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