Commit 50919849 authored by Rau Layug's avatar Rau Layug

Added Event model in calendarapp

parents 537ce5fc e6b01d65
......@@ -12,3 +12,4 @@
5. Stephanie Tullao
- Forum
## LAB 1 VIDEO: https://drive.google.com/file/d/1IESyuTnQGhbF3c3UP2WHlXNMC6RFL1lj/view?usp=sharing
from django.contrib import admin
from .models import Announcement
# Register your models here.
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
list_display = ('announcement_title', 'announcement_body', 'pub_date')
admin.site.register(Announcement, AnnouncementAdmin)
\ No newline at end of file
from django.db import models
# Create your models here.
class Announcement(models.Model):
announcement_title = models.CharField(max_length=150)
announcement_body = models.TextField()
pub_date = models.DateField(auto_now=True)
def __str__(self):
return '"{}" published {}'.format(self.announcement_title, self.pub_date)
\ No newline at end of file
from django.contrib import admin
from .models import WidgetUser
# Register your models here.
class WidgetUserAdmin(admin.ModelAdmin):
model = WidgetUser
search_fields = ('first_name','last_name')
list_display = ('first_name','middle_name','last_name')
list_filter = ('last_name', 'first_name')
admin.site.register(WidgetUser, WidgetUserAdmin)
\ No newline at end of file
from django.db import models
# Create your models here.
class WidgetUser(models.Model):
first_name = models.CharField(max_length=35)
middle_name = models.CharField(max_length=20)
last_name= models.CharField(max_length=20)
def __str__(self):
return 'Name: {}, {} {}'.format(self.last_name, self.first_name, self.last_name)
\ 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