{% block file-list-wrapper %}
- {% for k, objects in objects_by_status.items %}
+ {% for k, objects in status_objects %}
<h2>{{ k.1 }}</h2>
<ul>
{% for file in objects %}
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
+ <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css?20110808" />
<title>{% trans "Audiobook repository" %}</title>
</head>
<body>
from django.db.models import Q, Max
from django.http import Http404
from django.shortcuts import render, redirect, get_object_or_404
-from django.utils.datastructures import SortedDict
from django.views.decorators.http import require_POST
import mutagen
division = 'publishing'
objects = models.Audiobook.objects.exclude(mp3_status=None, ogg_status=None)
- objects_by_status = SortedDict()
+ objects_by_status = {}
for o in objects:
if o.mp3_status:
k = o.mp3_status, o.get_mp3_status_display()
if o.ogg_status and o.ogg_status != o.mp3_status:
k = o.ogg_status, o.get_ogg_status_display()
objects_by_status.setdefault(k, []).append(o)
+ status_objects = sorted(objects_by_status.items(), reverse=True)
return render(request, "archive/list_publishing.html", locals())