new press template and view

pull/1/head
Andromeda Yelton 2013-04-04 10:15:29 -04:00
parent 00ab8f4d18
commit db0a967963
2 changed files with 11 additions and 0 deletions

View File

@ -102,6 +102,7 @@ urlpatterns = patterns(
url(r"^ml/status/$","ml_status", name="ml_status"),
url(r"^ml/subscribe/$","ml_subscribe", name="ml_subscribe"),
url(r"^ml/unsubscribe/$","ml_unsubscribe", name="ml_unsubscribe"),
url(r"^press_new/$","press_new", name="press_new"),
)
if settings.DEBUG:

View File

@ -2343,3 +2343,13 @@ def ml_subscribe(request):
def ml_unsubscribe(request):
request.user.profile.ml_unsubscribe()
return HttpResponseRedirect(reverse("notification_notice_settings"))
def press_new(request):
latest_items = models.Press.objects.order_by('-date')[:3]
highlighted_items = models.Press.objects.filter(highlight=True)
all_items = models.Press.objects.all()
return render(request, "press_new.html", {
'latest_items': latest_items,
'highlighted_items': highlighted_items,
'all_items': all_items
})