Migrated and fixed output of views

parent de808f3e
# Generated by Django 3.2 on 2023-03-06 03:22
# Generated by Django 3.2 on 2023-03-06 13:34
import datetime
from django.db import migrations, models
......@@ -10,6 +10,7 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('assignments', '0002_alter_course_course_code'),
]
operations = [
......@@ -25,10 +26,10 @@ class Migration(migrations.Migration):
name='Event',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('target_datetime', models.DateTimeField(default=datetime.datetime(2023, 3, 6, 11, 22, 4, 870125))),
('target_datetime', models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 34, 56, 441115))),
('activity', models.CharField(default='', max_length=100)),
('estimated_hours', models.FloatField(default=0)),
('course', models.CharField(default='', max_length=100)),
('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assignments.course')),
('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='Venue', to='widget_calendar.location')),
],
),
......
# Generated by Django 3.2 on 2023-03-06 03:22
# Generated by Django 3.2 on 2023-03-06 13:35
import datetime
from django.db import migrations, models
......@@ -14,6 +14,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 11, 22, 12, 776680)),
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 35, 57, 125720)),
),
]
# Generated by Django 3.2 on 2023-03-06 13:36
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0002_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 36, 3, 571433)),
),
]
# Generated by Django 3.2 on 2023-03-06 13:36
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0003_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 36, 8, 203438)),
),
]
# Generated by Django 3.2 on 2023-03-06 13:36
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0004_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 36, 15, 496092)),
),
]
# Generated by Django 3.2 on 2023-03-06 13:36
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('widget_calendar', '0005_alter_event_target_datetime'),
]
operations = [
migrations.AlterField(
model_name='event',
name='target_datetime',
field=models.DateTimeField(default=datetime.datetime(2023, 3, 6, 21, 36, 18, 142763)),
),
]
from django.db import models
from widget_vincentdjango.assignments.models import Course
from datetime import datetime
from assignments.models import Course
class Location(models.Model):
mode = models.CharField(max_length=100, default="")
......@@ -18,7 +19,6 @@ class Event(models.Model):
course = models.ForeignKey(
Course,
on_delete=models.CASCADE,
related_name='Section'
)
location = models.ForeignKey(
Location,
......@@ -27,4 +27,4 @@ class Event(models.Model):
)
def __str__(self):
return "{} {} {} {}".format(self.target_datetime, self.activity, self.estimated_hours, self.course, self.location)
return "{} {} {} {}".format(self.target_datetime, self.activity, self.estimated_hours, self.location)
......@@ -24,7 +24,7 @@ def index(request):
Date and Time: "+datetime+" <br>\
Activity: "+event.activity+" <br>\
Estimated Hours: "+estimated_hours+" <br>\
Course/Section: "+event.course+" <br>\
Course/Section: "+event.course.course_title+" <br>\
Mode: "+location.mode+" <br>\
Venue: "+location.venue+" <br>\
</p>"
......
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