Commit 537ce5fc authored by Rau Layug's avatar Rau Layug

Created calendarapp model, added admin view for the calendarapp, and updated...

Created calendarapp model, added admin view for the calendarapp, and updated INSTALLED_APPS. (replaced 'calendar' with 'calendarapp')
parent bc834941
from django.contrib import admin from django.contrib import admin
from .models import Event
# Register your models here. # Register your models here.
class EventAdmin(admin.ModelAdmin):
model = Event
list_display = ('target_date', 'activity', 'estimated_hours')
admin.site.register(Event, EventAdmin)
\ No newline at end of file
# Generated by Django 4.0.3 on 2022-03-17 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Event',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('target_date', models.DateField()),
('activity', models.CharField(max_length=150)),
('estimated_hours', models.FloatField()),
],
),
]
from django.db import models from django.db import models
# Create your models here. # Create your models here.
class Event(models.Model):
target_date = models.DateField()
activity = models.CharField(max_length=150)
estimated_hours = models.FloatField()
def __str__(self):
return '{} with {} hours duration on {} '.format(self.activity, self.estimated_hours, self.target_date)
\ No newline at end of file
...@@ -44,7 +44,7 @@ INSTALLED_APPS = [ ...@@ -44,7 +44,7 @@ INSTALLED_APPS = [
'announcementboard', 'announcementboard',
'forum', 'forum',
'assignments', 'assignments',
'calendar' 'calendarapp'
] ]
MIDDLEWARE = [ MIDDLEWARE = [
......
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