Commit d913f342 authored by Jose Gabriel L. Salas's avatar Jose Gabriel L. Salas

rearranged admin list_displays for both event and location app

parent e584e153
......@@ -6,7 +6,10 @@ from .models import Event, Location
class EventAdmin(admin.ModelAdmin):
model = Event
search_fields = ('activity', 'target_datetime', 'course', )
list_display = ('activity', 'target_datetime', )
list_display = (
'target_datetime', 'activity', 'estimated_hours',
'location', 'course',
)
list_filter = ('target_datetime', 'course', )
fieldsets = [
('Activity', {
......@@ -21,7 +24,7 @@ class EventAdmin(admin.ModelAdmin):
class LocationAdmin(admin.ModelAdmin):
model = Location
search_fields = ('venue', 'mode', )
list_display = ('venue', 'mode', )
list_display = ('mode', 'venue', )
list_filter = ('mode', )
......
# Generated by Django 4.1.7 on 2023-03-04 18:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0003_alter_event_location'),
]
operations = [
migrations.AlterField(
model_name='event',
name='location',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='widget_calendar.location'),
),
]
......@@ -15,7 +15,7 @@ def index(request):
return_string += 'Estimated Hours: {}<br>'.format(round_hours)
return_string += 'Course/Section: {}<br>'.format(events.course)
return_string += 'Mode: {}<br>'.format(events.location.mode)
return_string += 'Venue: {}<br>'.format(events.location.venue)
return_string += 'Venue: {}<br></li>'.format(events.location.venue)
return_string += '<br>'
return_string += '</ul>'
......
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