Added the models and updated view output

parent 76444e33
from django.contrib import admin
from .models import Event, Location
# Register your models here.
from django.db import models
# Create your models here.
class Event(models.Model):
target_datetime = models.CharField(max_length=100, default="")
activity = models.CharField(max_length=100, default="")
estimated_hours = models.FloatField(default=0)
location = models.CharField(max_length=100, default="")
course = models.CharField(max_length=100, default="")
def __str__(self):
return '{}, {}'.format(self.dept_name, self.home_unit)
class Location(models.Model):
mode = models.CharField(max_length=100, default="")
venue = models.CharField(max_length=100, default="")
def __str__(self):
return '{}, {}'.format(self.mode, self.venue)
\ No newline at end of file
......@@ -3,6 +3,21 @@ from django.http import HttpResponse
def index(request):
head = "<h1 style='border-bottom:4px solid lightgray;\
padding-bottom:30px;\
font-size:500%;'>\
Widget’s Calendar of Activities\
</h1>"
body = ""
return_string = "<html>\
<body style = 'font-family:helvetica;\
padding:30px;'>\
{}{}\
</body></html>".format(head, body)
return HttpResponse("Widget’s Calendar of Activities<br>"
"Date and Time: <target date>, <target time><br>"
"Activity: <activity><br>"
......
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