-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
964cbab
commit 0e59a91
Showing
1 changed file
with
4 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
from profile.models import ResumeSummary | ||
|
||
from django.shortcuts import render | ||
from projects.models import IMAGE_COUNT, Project | ||
from profile.models import ResumeSummary | ||
|
||
|
||
def project_index(request): | ||
projects = Project.objects.all().order_by("-date") | ||
resume_summary = ResumeSummary.objects.first() | ||
context = { | ||
"projects": projects, | ||
"summary": resume_summary | ||
} | ||
context = {"projects": projects, "summary": resume_summary} | ||
return render(request, "projects/project_index.html", context) | ||
|
||
|
||
def project_detail(request, pk): | ||
project = Project.objects.get(pk=pk) | ||
project_images = [project.__getattribute__(f"image{i}") for i in range(1, IMAGE_COUNT + 1)] | ||
resume_summary = ResumeSummary.objects.first() | ||
context = { | ||
"project": project, | ||
"project_images": project_images, | ||
"summary": resume_summary | ||
} | ||
context = {"project": project, "project_images": project_images, "summary": resume_summary} | ||
return render(request, "projects/project_detail.html", context) |