Skip to content

Commit

Permalink
url params: meeting detail
Browse files Browse the repository at this point in the history
  • Loading branch information
pylbatu committed Apr 29, 2020
1 parent c5fa757 commit 99bfc36
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions meeting_planner/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
from django.contrib import admin
from django.urls import path
from website.views import welcome, date, about
from meetings.views import detail

urlpatterns = [
path('admin/', admin.site.urls),
path('', welcome),
path('date', date),
path('about', about),
path('detail/<int:id>', detail)
]
17 changes: 17 additions & 0 deletions meetings/templates/meetings/detail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
Meeting Details
</title>
</head>
<body>
<h1>
{{ meeting.title }}
</h1>
<p>
Meeting is on {{ meeting.date }} {{meeting.time }} for {{meeting.duration_in_hours}} hours.
</p>
</body>
</html>
9 changes: 9 additions & 0 deletions meetings/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
from .models import Meeting

from django.shortcuts import render

# Create your views here.


def detail(request, id):
meeting = Meeting.objects.get
return render(request, 'meetings/detail.html', {
'meeting': meeting
})

0 comments on commit 99bfc36

Please sign in to comment.