Mercurial > public > bravenewsurf
annotate bns_website/videos/views.py @ 68:1d50a0db4f21
- I moved the jplayer files to a jplayer dir under static/js. I thought about moving the flash file to another dir, but thought it'd be best to leave it with the rest of the jplayer files.
- I removed some rogue colons in the music.html template.
author | Bob Mourlam <bob.mourlam@gmail.com> |
---|---|
date | Wed, 23 Nov 2011 09:16:47 -0600 |
parents | a0d3bc630ebd |
children |
rev | line source |
---|---|
bgneal@60 | 1 """ |
bgneal@60 | 2 Views for the videos application. |
bgneal@60 | 3 |
bgneal@60 | 4 """ |
bgneal@60 | 5 import random |
bgneal@60 | 6 from django.shortcuts import render |
bgneal@60 | 7 from videos.models import Playlist |
bgneal@60 | 8 |
bgneal@60 | 9 |
bgneal@60 | 10 def index(request): |
bgneal@60 | 11 qs = Playlist.objects.all() |
bgneal@60 | 12 videos = [] |
bgneal@60 | 13 for playlist in qs: |
bgneal@60 | 14 videos.extend(playlist.video_list.split(',')) |
bgneal@60 | 15 |
bgneal@60 | 16 random.shuffle(videos) |
bgneal@60 | 17 |
bgneal@60 | 18 return render(request, 'videos/index.html', { |
bgneal@60 | 19 'videos': videos, |
bgneal@60 | 20 }) |