From f4551d4630b55aca5149c54c81f4d7d974457cba Mon Sep 17 00:00:00 2001 From: luxagraf Date: Mon, 25 Mar 2019 12:25:45 -0600 Subject: added audio to image insert --- app/utils/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/utils') diff --git a/app/utils/views.py b/app/utils/views.py index cd72961..60cb7de 100644 --- a/app/utils/views.py +++ b/app/utils/views.py @@ -3,11 +3,13 @@ import json from django.http import Http404, HttpResponse from django.views.generic import ListView from django.apps import apps -from photos.models import LuxImage, LuxVideo from django.shortcuts import render_to_response from django.shortcuts import render from django.template import RequestContext +from photos.models import LuxImage, LuxVideo +from recordings.models import Audio + class PaginatedListView(ListView): """ @@ -34,8 +36,9 @@ def insert_image(request): """ images = LuxImage.objects.all()[:80] videos = LuxVideo.objects.all()[:10] + audio = Audio.objects.all()[:40] object_list = sorted( - chain(images, videos), + chain(images, videos, audio), key=lambda instance: instance.pub_date, reverse=True ) -- cgit v1.2.3-70-g09d2