add flatpages

This commit is contained in:
2021-05-13 16:31:05 +00:00
parent bf41aeca1a
commit 66dc28da88
21 changed files with 237 additions and 20 deletions

View File

@@ -1,17 +1,16 @@
from datetime import timedelta
from django.shortcuts import render
from django.utils import timezone
from datetime import timedelta
from core.models import CustomFlatPage
from .models import JobPosting
from posts.models import Post
def index(request):
job_postings_cutoff = timezone.now().date() - timedelta(30) # 30days from now
job_postings = JobPosting.all_jobPosting.filter(publishDate__gt=job_postings_cutoff)
bb_info = Post.objects.filter(slug="blackboard").first()
bb_empty = Post.objects.filter(slug="blackboard-empty").first()
bb_info = CustomFlatPage.objects.filter(title__iexact="blackboard").first()
bb_empty = CustomFlatPage.objects.filter(title__iexact="blackboard empty").first()
context = {
"job_postings": job_postings,