website/conservancy/contractpatch/views.py

17 lines
371 B
Python
Raw Normal View History

2016-11-28 19:53:27 +00:00
from datetime import datetime
from django.shortcuts import render
from ..blog.models import Entry
2016-11-28 19:53:27 +00:00
def index(request):
filters = {
'pub_date__lte': datetime.now(),
'tags__slug': 'ContractPatch',
}
context = {
'blog_entries': Entry.objects.filter(**filters)[:3],
2016-11-28 19:53:27 +00:00
}
return render(request, "contractpatch/index.html", context)