Commit 598be356 authored by Gabriel Geraldo's avatar Gabriel Geraldo

created admin panel and populated models of app widget_calendar

parent 48c53b1f
from django.contrib import admin from django.contrib import admin
from .models import Location, Event
# Register your models here.
class LocationAdmin(admin.ModelAdmin):
model = Location
list_display = ("venue", "mode")
search_fields = ("venue",)
list_filter = ("mode",)
class EventAdmin(admin.ModelAdmin):
model = Event
list_display = ("course", "activity", "target_datetime")
search_fields = ("activity", "course")
list_filter = ("course",)
admin.site.register(Location, LocationAdmin)
admin.site.register(Event, EventAdmin)
...@@ -3,9 +3,9 @@ from assignments.models import Course ...@@ -3,9 +3,9 @@ from assignments.models import Course
class Location(models.Model): class Location(models.Model):
ONSITE = 'onsite' ONSITE = 'ONSITE'
ONLINE = 'online' ONLINE = 'ONLINE'
HYBRID = 'hybrid' HYBRID = 'HYBRID'
MODE_CHOICES = [ MODE_CHOICES = [
(ONSITE, 'Onsite'), (ONSITE, 'Onsite'),
(ONLINE, 'Online'), (ONLINE, 'Online'),
...@@ -21,8 +21,8 @@ class Location(models.Model): ...@@ -21,8 +21,8 @@ class Location(models.Model):
def __str__(self): def __str__(self):
return '{} ({})'.format( return '{} ({})'.format(
self.mode, self.venue,
self.title self.mode
) )
......
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