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 .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
class Location(models.Model):
ONSITE = 'onsite'
ONLINE = 'online'
HYBRID = 'hybrid'
ONSITE = 'ONSITE'
ONLINE = 'ONLINE'
HYBRID = 'HYBRID'
MODE_CHOICES = [
(ONSITE, 'Onsite'),
(ONLINE, 'Online'),
......@@ -21,8 +21,8 @@ class Location(models.Model):
def __str__(self):
return '{} ({})'.format(
self.mode,
self.title
self.venue,
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